awesomemotive / WP-Mail-SMTP

The most popular WordPress SMTP and PHP Mailer plugin. Trusted by over 3 million sites.
https://wordpress.org/plugins/wp-mail-smtp/
GNU General Public License v3.0
55 stars 34 forks source link

Mailgun provider does not support string attachments #102

Closed Buddierdl closed 2 years ago

Buddierdl commented 3 years ago

Expected Behavior

When images are added to an email using the AddStringEmbeddedImage() function of PHPMailer, they should be attached to the email.

Current Behavior

The images stored as a string are ignored and not attached to the email when using the mailgun provider.

Possible Solution

In the set_attachments function, we need to check $attachment[5], which will be true if the attachment is a string. In that case the $attachment[0] should be interpreted as the image itself and not as a file location to be read. I will create a commit for this.

capuderg commented 3 years ago

Hi @Buddierdl,

thank you for reporting this issue and also for providing the Pull-request. We really appreciate it.

The issue is probably not present only for the Mailgun mailer, so we'll have to look into fixing it for all our mailers. Please allow us some time to work on a full fix (all mailers). We plan to release v3.1 by the end of September (note: the date can change).

So we will test and merge this PR before that release.

Take care!

capuderg commented 2 years ago

WP Mail SMTP v3.1.0 was just released and we fixed the string attachments.

Thank you for opening this GH and providing a PR!

I'm going to close this GH issue and PR, since we merged the code from our master repo to this public repo for the lite version of the plugin.