Quantcast
Channel: WordPress.org Forums » [WP Mail SMTP by WPForms - The Most Popular SMTP and Email Log Plugin] Support
Viewing all articles
Browse latest Browse all 5014

Sending HTML won’t set plaintext alternative

$
0
0

Replies: 0

When using WP Mail SMTP to send an HTML email, the phpmailer AltBody content is not being set.

I guess probably this is happening with all providers because when there’s a Body and an AltBody, phpmailer sets the content type to multipart/alternative and not text/html.

On MailerAbstract.php, line 108, you’re only looking at text/html to determine if you’re going to set both HTML and text versions, or else you’ll only set one version.

This is easily fixed by changing:
if ( $this->phpmailer->ContentType === 'text/html' ) {
to:
if ( $this->phpmailer->ContentType === 'text/html' || $this->phpmailer->ContentType === 'multipart/alternative' ) {


Viewing all articles
Browse latest Browse all 5014


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>