Jump to content

How to change sender address for automated emails sent through PHP?


Recommended Posts

I was writing PHP code to send users of my site an automated email for account creation/verification... However, when I tested the code everything worked just fine, except the sender is myusername@myusername.heliohost.org.


How can I change this address so that users see that the email is sent by myusername@mydomain.com instead? I know it has something to do with changing Service Configuration/PHP Configuration but I can't even find that in my cPanel... Please advise on what to do next. Thanks in advance!

Link to comment
Share on other sites

Hi, thank you so much for the quick response. Obviously, I missed a critical part of the code and jumped to conclusions. I tried it with the header From code added and now the sender email shows as myusername@mydomain.com but is now followed by "via tommy.heliohost.org".


Is there a way to change this or is this as far as PHP can go codewise? I'm thinking that the mail client automatically appends the "via tommy.heliohost.org". If not, how should I proceed? Thanks again!

Edited by studius
Link to comment
Share on other sites

That's your mail client adding that as a security measure. Some clients do it, some don't. It usually appears when the rDNS of the sending server does not match the domain in the From header. Since you're on a shared server, the rDNS will resolve back to servername.heliohost.org. If you set the From as something@tommy.heliohost.org you wouldn't see that since the domains would match.


Gmail is probably the most widely known one that does this.


The idea behind it is to help users in scenarios where someone makes the From address something nefarious such as update-your-account@paypal.com, the via is there to make it easier for users to see it's phishing and did not actually come from PayPal.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...