equal
deleted
inserted
replaced
33 /** |
33 /** |
34 * The PHPMailer SMTP version number. |
34 * The PHPMailer SMTP version number. |
35 * |
35 * |
36 * @var string |
36 * @var string |
37 */ |
37 */ |
38 const VERSION = '6.5.0'; |
38 const VERSION = '6.6.0'; |
39 |
39 |
40 /** |
40 /** |
41 * SMTP line break constant. |
41 * SMTP line break constant. |
42 * |
42 * |
43 * @var string |
43 * @var string |
185 'Microsoft_ESMTP' => '/[0-9]{3} 2.[\d].0 (.*)@(?:.*) Queued mail for delivery/', |
185 'Microsoft_ESMTP' => '/[0-9]{3} 2.[\d].0 (.*)@(?:.*) Queued mail for delivery/', |
186 'Amazon_SES' => '/[\d]{3} Ok (.*)/', |
186 'Amazon_SES' => '/[\d]{3} Ok (.*)/', |
187 'SendGrid' => '/[\d]{3} Ok: queued as (.*)/', |
187 'SendGrid' => '/[\d]{3} Ok: queued as (.*)/', |
188 'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/', |
188 'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/', |
189 'Haraka' => '/[\d]{3} Message Queued \((.*)\)/', |
189 'Haraka' => '/[\d]{3} Message Queued \((.*)\)/', |
|
190 'Mailjet' => '/[\d]{3} OK queued as (.*)/', |
190 ]; |
191 ]; |
191 |
192 |
192 /** |
193 /** |
193 * The last transaction ID issued in response to a DATA command, |
194 * The last transaction ID issued in response to a DATA command, |
194 * if one was detected. |
195 * if one was detected. |
390 $errstr, |
391 $errstr, |
391 $timeout, |
392 $timeout, |
392 STREAM_CLIENT_CONNECT, |
393 STREAM_CLIENT_CONNECT, |
393 $socket_context |
394 $socket_context |
394 ); |
395 ); |
395 restore_error_handler(); |
|
396 } else { |
396 } else { |
397 //Fall back to fsockopen which should work in more places, but is missing some features |
397 //Fall back to fsockopen which should work in more places, but is missing some features |
398 $this->edebug( |
398 $this->edebug( |
399 'Connection: stream_socket_client not available, falling back to fsockopen', |
399 'Connection: stream_socket_client not available, falling back to fsockopen', |
400 self::DEBUG_CONNECTION |
400 self::DEBUG_CONNECTION |
405 $port, |
405 $port, |
406 $errno, |
406 $errno, |
407 $errstr, |
407 $errstr, |
408 $timeout |
408 $timeout |
409 ); |
409 ); |
410 restore_error_handler(); |
410 } |
411 } |
411 restore_error_handler(); |
412 |
412 |
413 //Verify we connected properly |
413 //Verify we connected properly |
414 if (!is_resource($connection)) { |
414 if (!is_resource($connection)) { |
415 $this->setError( |
415 $this->setError( |
416 'Failed to connect to server', |
416 'Failed to connect to server', |
481 * @see hello() |
481 * @see hello() |
482 * |
482 * |
483 * @param string $username The user name |
483 * @param string $username The user name |
484 * @param string $password The password |
484 * @param string $password The password |
485 * @param string $authtype The auth type (CRAM-MD5, PLAIN, LOGIN, XOAUTH2) |
485 * @param string $authtype The auth type (CRAM-MD5, PLAIN, LOGIN, XOAUTH2) |
486 * @param OAuth $OAuth An optional OAuth instance for XOAUTH2 authentication |
486 * @param OAuthTokenProvider $OAuth An optional OAuthTokenProvider instance for XOAUTH2 authentication |
487 * |
487 * |
488 * @return bool True if successfully authenticated |
488 * @return bool True if successfully authenticated |
489 */ |
489 */ |
490 public function authenticate( |
490 public function authenticate( |
491 $username, |
491 $username, |
694 } |
694 } |
695 |
695 |
696 /** |
696 /** |
697 * Send an SMTP DATA command. |
697 * Send an SMTP DATA command. |
698 * Issues a data command and sends the msg_data to the server, |
698 * Issues a data command and sends the msg_data to the server, |
699 * finializing the mail transaction. $msg_data is the message |
699 * finalizing the mail transaction. $msg_data is the message |
700 * that is to be send with the headers. Each header needs to be |
700 * that is to be send with the headers. Each header needs to be |
701 * on a single line followed by a <CRLF> with the message headers |
701 * on a single line followed by a <CRLF> with the message headers |
702 * and the message body being separated by an additional <CRLF>. |
702 * and the message body being separated by an additional <CRLF>. |
703 * Implements RFC 821: DATA <CRLF>. |
703 * Implements RFC 821: DATA <CRLF>. |
704 * |
704 * |
1168 public function getServerExt($name) |
1168 public function getServerExt($name) |
1169 { |
1169 { |
1170 if (!$this->server_caps) { |
1170 if (!$this->server_caps) { |
1171 $this->setError('No HELO/EHLO was sent'); |
1171 $this->setError('No HELO/EHLO was sent'); |
1172 |
1172 |
1173 return; |
1173 return null; |
1174 } |
1174 } |
1175 |
1175 |
1176 if (!array_key_exists($name, $this->server_caps)) { |
1176 if (!array_key_exists($name, $this->server_caps)) { |
1177 if ('HELO' === $name) { |
1177 if ('HELO' === $name) { |
1178 return $this->server_caps['EHLO']; |
1178 return $this->server_caps['EHLO']; |
1180 if ('EHLO' === $name || array_key_exists('EHLO', $this->server_caps)) { |
1180 if ('EHLO' === $name || array_key_exists('EHLO', $this->server_caps)) { |
1181 return false; |
1181 return false; |
1182 } |
1182 } |
1183 $this->setError('HELO handshake was used; No information about server extensions available'); |
1183 $this->setError('HELO handshake was used; No information about server extensions available'); |
1184 |
1184 |
1185 return; |
1185 return null; |
1186 } |
1186 } |
1187 |
1187 |
1188 return $this->server_caps[$name]; |
1188 return $this->server_caps[$name]; |
1189 } |
1189 } |
1190 |
1190 |