@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | ) { |
40 | 40 | $this->mail = new PHPMailer(true); |
41 | - $this->data = new \stdClass(); |
|
41 | + $this->data = new \stdClass(); |
|
42 | 42 | //Server settings |
43 | 43 | $this->mail->SMTPDebug = $smtpDegug; // Enable verbose debug output |
44 | 44 | $this->mail->isSMTP(); // Send using SMTP |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
84 | - * @param string $email |
|
85 | - * @return bool |
|
86 | - */ |
|
84 | + * @param string $email |
|
85 | + * @return bool |
|
86 | + */ |
|
87 | 87 | function is_email(string $email): bool |
88 | 88 | { |
89 | 89 | return filter_var($email, FILTER_VALIDATE_EMAIL); |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | |
110 | 110 | if (!$this->is_email($from)) { |
111 | 111 | echo "<b>O e-mail de remetente não é válido:</b> "; |
112 | - return false; |
|
112 | + return false; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | try { |
116 | 116 | $this->mail->Subject = $this->data->subject; |
117 | - $this->mail->msgHTML($this->data->body); |
|
118 | - $this->mail->addAddress($this->data->recipient_email, $this->data->recipient_name); |
|
117 | + $this->mail->msgHTML($this->data->body); |
|
118 | + $this->mail->addAddress($this->data->recipient_email, $this->data->recipient_name); |
|
119 | 119 | $this->mail->setFrom($from, $fromName); |
120 | 120 | |
121 | 121 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | |
145 | 145 | if (!is_email($from)) { |
146 | 146 | echo "O e-mail de remetente não é válido: {$this->mail->ErrorInfo} {$e->getMessage()}"; |
147 | - return false; |
|
147 | + return false; |
|
148 | 148 | } |
149 | 149 | return true; |
150 | 150 | } |
@@ -40,14 +40,14 @@ discard block |
||
40 | 40 | $this->mail = new PHPMailer(true); |
41 | 41 | $this->data = new \stdClass(); |
42 | 42 | //Server settings |
43 | - $this->mail->SMTPDebug = $smtpDegug; // Enable verbose debug output |
|
44 | - $this->mail->isSMTP(); // Send using SMTP |
|
45 | - $this->mail->Host = $host; // Set the SMTP server to send through |
|
46 | - $this->mail->SMTPAuth = true; // Enable SMTP authentication |
|
47 | - $this->mail->Username = $user; // SMTP username |
|
48 | - $this->mail->Password = $passwd; // SMTP password |
|
49 | - $this->mail->SMTPSecure = $smtpSecure; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS |PHPMailer::ENCRYPTION_STARTTLS` also accepted |
|
50 | - $this->mail->Port = $port; // TCP port to connect to |
|
43 | + $this->mail->SMTPDebug = $smtpDegug; // Enable verbose debug output |
|
44 | + $this->mail->isSMTP(); // Send using SMTP |
|
45 | + $this->mail->Host = $host; // Set the SMTP server to send through |
|
46 | + $this->mail->SMTPAuth = true; // Enable SMTP authentication |
|
47 | + $this->mail->Username = $user; // SMTP username |
|
48 | + $this->mail->Password = $passwd; // SMTP password |
|
49 | + $this->mail->SMTPSecure = $smtpSecure; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS |PHPMailer::ENCRYPTION_STARTTLS` also accepted |
|
50 | + $this->mail->Port = $port; // TCP port to connect to |
|
51 | 51 | $this->mail->CharSet = $charSEt; |
52 | 52 | $this->mail->setLanguage($language); |
53 | 53 | $this->mail->isHTML(true); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | return false; |
133 | 133 | } |
134 | 134 | } |
135 | - public function attempt($from){ |
|
135 | + public function attempt($from) { |
|
136 | 136 | if (empty($this->data)) { |
137 | 137 | echo "Erro ao enviar o e-mail com parametros vasios: {$this->mail->ErrorInfo} {$e->getMessage()}"; |
138 | 138 | return false; |
@@ -8,8 +8,8 @@ |
||
8 | 8 | $notification = new Email( |
9 | 9 | 2, |
10 | 10 | CONF_MAIL_HOST, // criar difine em um arquivo config.php |
11 | - CONF_MAIL_USER,// criar difine em um arquivo config.php |
|
12 | - CONF_MAIL_PASS,// criar difine em um arquivo config.php |
|
11 | + CONF_MAIL_USER, // criar difine em um arquivo config.php |
|
12 | + CONF_MAIL_PASS, // criar difine em um arquivo config.php |
|
13 | 13 | 'tls' |
14 | 14 | ); |
15 | 15 |