@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | } |
386 | 386 | $filename = $this->encodeUtf8($this->filterOther((string) $filename)); |
387 | 387 | if (empty($data)) { |
388 | - $data = $this->getAttachmentData($path); |
|
388 | + $data = $this->getAttachmentData($path); |
|
389 | 389 | } |
390 | 390 | $this->attachments[] = array( |
391 | 391 | 'path' => $path, |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | $addresses = array(); |
427 | 427 | foreach ($pairs as $name => $email) { |
428 | 428 | if (is_numeric($name)) { |
429 | - $name = null; |
|
429 | + $name = null; |
|
430 | 430 | } |
431 | 431 | $addresses[] = $this->formatHeader($email, $name); |
432 | 432 | } |
@@ -970,10 +970,10 @@ discard block |
||
970 | 970 | return $headers; |
971 | 971 | } |
972 | 972 | |
973 | - /** |
|
974 | - * Get the attachment message for send or the simple message |
|
975 | - * @return string |
|
976 | - */ |
|
973 | + /** |
|
974 | + * Get the attachment message for send or the simple message |
|
975 | + * @return string |
|
976 | + */ |
|
977 | 977 | protected function getMessageWithAttachmentForSend() { |
978 | 978 | $message = $this->getWrapMessage(); |
979 | 979 | if ($this->hasAttachments()) { |
@@ -1010,11 +1010,11 @@ discard block |
||
1010 | 1010 | */ |
1011 | 1011 | protected function sendHelloCommand() { |
1012 | 1012 | $responseCode = $this->sendCommand('EHLO ' . $this->getSmtpClientHostname()) |
1013 | - ->getSmtpResponseCode(); |
|
1013 | + ->getSmtpResponseCode(); |
|
1014 | 1014 | if ($responseCode !== 250) { |
1015 | 1015 | //May be try with "HELO" |
1016 | 1016 | $responseCode = $this->sendCommand('HELO ' . $this->getSmtpClientHostname()) |
1017 | - ->getSmtpResponseCode(); |
|
1017 | + ->getSmtpResponseCode(); |
|
1018 | 1018 | if ($responseCode !== 250) { |
1019 | 1019 | $this->error = $this->smtpResponse; |
1020 | 1020 | return false; |
@@ -1158,7 +1158,7 @@ discard block |
||
1158 | 1158 | $message = $this->getMessageWithAttachmentForSend(); |
1159 | 1159 | $headers = $this->getHeadersForSend(); |
1160 | 1160 | $this->logger->info('Sending new mail using mail protocol, the information are listed below: ' |
1161 | - . 'destination: ' . $to . ', headers: ' . $headers . ', message: ' . $message); |
|
1161 | + . 'destination: ' . $to . ', headers: ' . $headers . ', message: ' . $message); |
|
1162 | 1162 | $result = mail($to, $this->subject, $message, $headers, $this->params); |
1163 | 1163 | if (!$result) { |
1164 | 1164 | $this->error = 'Error when sending mail using mail protocol'; |
@@ -1166,10 +1166,10 @@ discard block |
||
1166 | 1166 | return $result; |
1167 | 1167 | } |
1168 | 1168 | |
1169 | - /** |
|
1170 | - * Send mail using "smtp" protocol |
|
1171 | - * @return boolean |
|
1172 | - */ |
|
1169 | + /** |
|
1170 | + * Send mail using "smtp" protocol |
|
1171 | + * @return boolean |
|
1172 | + */ |
|
1173 | 1173 | protected function sendSmtp() { |
1174 | 1174 | if (!$this->smtpConnection()) { |
1175 | 1175 | return false; |
@@ -1189,7 +1189,7 @@ discard block |
||
1189 | 1189 | $message = $this->getMessageWithAttachmentForSend(); |
1190 | 1190 | $headers = $this->getHeadersForSend(); |
1191 | 1191 | $this->logger->info('Sending new mail using SMTP protocol, the information are listed below: ' |
1192 | - . 'destination: ' . $to . ', headers: ' . $headers . ', message: ' . $message); |
|
1192 | + . 'destination: ' . $to . ', headers: ' . $headers . ', message: ' . $message); |
|
1193 | 1193 | |
1194 | 1194 | $recipients = array_merge($this->to, $this->cc, $this->bcc); |
1195 | 1195 | $commands = array( |
@@ -1223,17 +1223,17 @@ discard block |
||
1223 | 1223 | return empty($this->error); |
1224 | 1224 | } |
1225 | 1225 | |
1226 | - /** |
|
1227 | - * Return the client hostname for SMTP |
|
1228 | - * |
|
1229 | - * There are only two legal types of hostname - either a fully |
|
1230 | - * qualified domain name (eg: "mail.example.com") or an IP literal |
|
1231 | - * (eg: "[1.2.3.4]"). |
|
1232 | - * |
|
1233 | - * @link https://tools.ietf.org/html/rfc5321#section-2.3.5 |
|
1234 | - * @link http://cbl.abuseat.org/namingproblems.html |
|
1235 | - * @return string |
|
1236 | - */ |
|
1226 | + /** |
|
1227 | + * Return the client hostname for SMTP |
|
1228 | + * |
|
1229 | + * There are only two legal types of hostname - either a fully |
|
1230 | + * qualified domain name (eg: "mail.example.com") or an IP literal |
|
1231 | + * (eg: "[1.2.3.4]"). |
|
1232 | + * |
|
1233 | + * @link https://tools.ietf.org/html/rfc5321#section-2.3.5 |
|
1234 | + * @link http://cbl.abuseat.org/namingproblems.html |
|
1235 | + * @return string |
|
1236 | + */ |
|
1237 | 1237 | protected function getSmtpClientHostname() { |
1238 | 1238 | $globals = &class_loader('GlobalVar', 'classes'); |
1239 | 1239 | if ($globals->server('SERVER_NAME')) { |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * SOFTWARE. |
29 | 29 | */ |
30 | 30 | |
31 | - class Email extends BaseClass{ |
|
31 | + class Email extends BaseClass { |
|
32 | 32 | /** |
33 | 33 | * @var int $wrap |
34 | 34 | */ |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | $message = $this->getWrapMessage(); |
979 | 979 | if ($this->hasAttachments()) { |
980 | 980 | $this->setAttachmentHeaders(); |
981 | - $message = $this->assembleAttachmentBody(); |
|
981 | + $message = $this->assembleAttachmentBody(); |
|
982 | 982 | } |
983 | 983 | return $message; |
984 | 984 | } |
@@ -1068,7 +1068,7 @@ discard block |
||
1068 | 1068 | $this->smtpConnectionTimeout |
1069 | 1069 | ); |
1070 | 1070 | |
1071 | - if (! is_resource($this->smtpSocket)) { |
|
1071 | + if (!is_resource($this->smtpSocket)) { |
|
1072 | 1072 | $this->error = $errorNumber . ':' . $errorMessage; |
1073 | 1073 | return false; |
1074 | 1074 | } |
@@ -1116,7 +1116,7 @@ discard block |
||
1116 | 1116 | * We want the negotiation, so we'll force it below ... |
1117 | 1117 | */ |
1118 | 1118 | $method = STREAM_CRYPTO_METHOD_TLS_CLIENT; |
1119 | - if(version_compare(PHP_VERSION, '5.6', '>=')) { |
|
1119 | + if (version_compare(PHP_VERSION, '5.6', '>=')) { |
|
1120 | 1120 | $method = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; |
1121 | 1121 | } |
1122 | 1122 | stream_socket_enable_crypto($this->smtpSocket, true, $method); |
@@ -1182,7 +1182,7 @@ discard block |
||
1182 | 1182 | 'To' => $to |
1183 | 1183 | ); |
1184 | 1184 | foreach ($additionalHeaders as $key => $value) { |
1185 | - if (! isset($this->headers[$key])) { |
|
1185 | + if (!isset($this->headers[$key])) { |
|
1186 | 1186 | $this->headers[$key] = $value; |
1187 | 1187 | } |
1188 | 1188 | } |