0PHP sendmail failing dmarc

I run a VPS which hosts sev­er­al domains. Send­ing mail from these domains has always been tricky. I’ve long used WP SMTP Mail plu­gin for word­press to work around this, but I wanted to get a prop­er fix. After much read­ing I found a prop­er solution


The prob­lem is that the “from” address and the “return to” address have to match and unless you know how to fully do the code they wont.

Code for non wordpress sites

 
Note, the key part is the final part, the extra value AFTER the head­ers. This is the extra para­met­ers part and we spe­cify the sender again with a ‑f command

For more info on this there is a good art­icle at Pupun­zi

For wordpress

Simply add the fol­low­ing code to your theme’s functions.php or cre­ate a cus­tom plu­gin with the code

Thanks to Kin­amo for the tip

Got some thoughts of your own? Indulge yourself below by commenting! If you would like to subscribe please use the subscribe link on the menu at the top right. You can also share this with your friends by using the social links below. Cheers.

Leave a Reply