wp_mail() should allow using PHPmailer's SMTP feature
|Reported by:||mastermind||Owned by:|
wp_mail() is able to use an already existing instance of PHPmailer. Unfortunately, all settings from the existing instance are then reset.
While this makes sense for things like addresses and subject, it is very bad that $phpmailer->IsMail() is called.
This makes it impossible to create and configure an own instance for usage with a remote MTA.
- Simply omit the call to $phpmailer->IsMail(), as 'mail' is already the default value.
- Move the call of $phpmailer->IsMail() into the if statement at the beginning of the wp_mail() function, so it will only be set if the instance is not set.
- Add a parameter to the signature of wp_mail() which allows to set the desired MTA backend.