Allow injecting an SMTP instance
This commit is contained in:
parent
262dc4997a
commit
cd2f977899
|
|
@ -55,6 +55,7 @@ This is a major update that breaks backwards compatibility.
|
|||
* Now checks for invalid host strings when sending via SMTP.
|
||||
* Include timestamps in HTML-format debug output
|
||||
* More reliable folding of message headers
|
||||
* Inject your own SMTP implementation via `setSMTPInstance()` instead of having to subclass and override `getSMTPInstance()`.
|
||||
|
||||
## Version 5.2.23 (March 15th 2017)
|
||||
* Improve trapping of TLS errors during connection so that they don't cause warnings, and are reported better in debug output
|
||||
|
|
|
|||
|
|
@ -1587,7 +1587,8 @@ class PHPMailer
|
|||
|
||||
/**
|
||||
* Get an instance to use for SMTP operations.
|
||||
* Override this function to load your own SMTP implementation
|
||||
* Override this function to load your own SMTP implementation,
|
||||
* or set one with setSMTPInstance.
|
||||
*
|
||||
* @return SMTP
|
||||
*/
|
||||
|
|
@ -1599,6 +1600,18 @@ class PHPMailer
|
|||
return $this->smtp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide an instance to use for SMTP operations.
|
||||
*
|
||||
* @param SMTP $smtp
|
||||
* @return SMTP
|
||||
*/
|
||||
public function setSMTPInstance(SMTP $smtp)
|
||||
{
|
||||
$this->smtp = $smtp;
|
||||
return $this->smtp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send mail via SMTP.
|
||||
* Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
|
||||
|
|
|
|||
Loading…
Reference in New Issue