On my site people can click on a form, enter a recipient email along with a short message, then click a button to send it. This part works good.
However, sometimes these users send an email to a friend’s account that bounces because their inbox is full. Right now these bounced messages are returning to the root email account for my domain. What more could I add to these headers so the bounced messages actually go back to the sender instead of me?
I’m not sure if setting headers will do what you want. We ended up using an SMTP library and setting the From: address when connecting to the SMTP server itself:
HELO [Your IP address]
RSET
MAIL FROM:$from
RCPT TO:$to
DATA
$headers
Try dropping ‘Return-Path’. It is probably throwing off mail servers. ‘Return-Path’ is supposed to be added by mail servers to figure out who to send notifications to when they fail to send the e-mail. Clients don’t need to nor should set such headers.
mail() is a poor-man’s solution to sending an e-mail. It barely works in this day and age and a lot of major web hosts are starting to block it for various reasons (usually spam reasons).
I just read the post you sent me to and it’s very clear you understand emailing issues far more than I do. Much of the thread was over my head. All I know is that a good amount of the email my website sends out gets rejected and sent back to me. How much would you charge to help me beef up my site so that it meets the necessary requirements and will not get blocked so much of the time?