Other SMTP won’t send HTML and Plain text email
-
Can I please get some help with “Other SMTP” email option.
The plugin is unable to send both HTML and Plain text version of the message. At the moment all emails are sent as HTML but that’s not good enough for a good email score.I’m working on my own plugin and this is my implementation to to send an email.
$subject= ‘My subject’;
$message='<doctype html> content here’;
$plaintextmsg = ‘my plain text msg using/r/n as line breaks. Is this correct?’;add_action(‘phpmailer_init’,’wp_mail_set_text_body’);
function wp_mail_set_text_body($phpmailer) {
if (empty($phpmailer->AltBody)) {$phpmailer->AltBody = $plaintextmsg;}
}
$headers = array( ‘Content-Type: text/html; charset=UTF-8’,’BCC: [email protected]‘ );
wp_mail( $email, $subject, $message, $headers );What am I doing wrong?
The issue is marked as resolved in previous tickets but I’m having issues with this still, using latest version of the plugin.Thanks!
- The topic ‘Other SMTP won’t send HTML and Plain text email’ is closed to new replies.