WPIntell

Source evidence

Huge problem when sending multiple mails + FIX

LH Multipart Email · support · 2018-10-16T10:49:00+00:00

mixedsentiment
highseverity
0.88relevance
4replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 34 rows with source links

17.6% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

28 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
y0uri resolved
Hi Pete, When the solution implemented in your plugin is used (same with the snippets on stackoverflow this is based on), the alternative text body is reused for different consecutive mails being sent. This results in recipients potentially receiving mails not meant for them. Luckily most people using HTML-enabled mail clients won’t see the text version, but it’s still a security problem in a way. I implemented your plugin on a site with Event Espresso and found that when approving a registration for an event, EE then sends multiple mails in one go. One mail notifying the event admin, and another, obviously different mail sent to the user. Your plugin checks, right before sending, if (1) it concerns a HTML mail and (2) if there’s no text-alternative specified. If both are yes, you provide a text alternative and let WP “hit send” on the phpmailer object. However, since WordPress doesn’t know you added an AltBody, on sending consecutive mails, it only clears the phpmailer properties it knows of, so it leaves the previous AltBody untouched. Since your plugin sees there’s an AltBody already present, it basically assumes everything’s fine and so each consecutive html mail will have the AltBody (text version) of the first mail that was sent. Hope you don’t mind, but I modified your plugin to fix this problem. I added extensive comments, reformatted the code and added a few filters for flexibility. Here’s a gist of the modified plugin, please use it as you like. I hope you decide to implement the changes so it gets pushed as an update. Thanks. This topic was modified 7 years, 7 months ago by y0uri . The page I need help with: [ log in to see the link] Many thanks, makes sense. I´ll test and if if all okay I will push it out as version 1.10, do you want me to add you asa contributor? Great! And sure, that’s cool, thanks. Y0uri, This has been done, ie your changes and a couple of other minor one have been added, and you are now a contributor Pete Cheers Pete. -Youri

Comments

4 shown
shawfactor 2018-10-18T04:59:00+00:00

Many thanks, makes sense. I´ll test and if if all okay I will push it out as version 1.10, do you want me to add you asa contributor?

y0uri 2018-10-24T09:27:00+00:00

Great! And sure, that’s cool, thanks.

shawfactor 2018-10-28T02:35:00+00:00

Y0uri, This has been done, ie your changes and a couple of other minor one have been added, and you are now a contributor Pete

y0uri 2018-10-29T12:29:00+00:00

Cheers Pete. -Youri