Wordpress Sender Email incorrect on HostMonster
On recently changing my webhost to ‘HostMonster’, I found that my blog, powered by Wordpress, doesnt send out the email the way I want it to.
Devesh had subscribed to one of my posts, and he received an email from me with the ID username@host#.hostmonster.com, when ideally it should have been sent by my email id.
The hostmonster forums have already discussed this problem, and the solution they mention on the website is
This is because our servers require you (or your script) to use a properly formatted, valid From: header in your email. If the From: header is not formatted correctly, empty or invalid our system will change the from address to be
@ .hostmonster.com. To stop this, you must change the script you are using to correctly use a valid From header.
Examples of headers that should work would be:
From: user@domain.com
From:
From: “name”
Examples of headers that will NOT work:
From: “user@domain.com”
From: user @ domain.com
Now, the above didnt make sense to me, so I searched for some other ways out.
Here is a quick solution to help you out of this problem.
Login to your Cpanel account, and open your ‘File Manager’.
Locate the php.ini file, which you can find under public_html/mail folder.
Copy this file to the root directory of your wordpress installation.
Now you need to search for the below line. Ideally it will be Line 604.
sendmail_path = /usr/sbin/sendmail -t -i
Change this line to
sendmail_path = /usr/sbin/sendmail -t -i -fusername@domain.com
-f is the command option, followed by the email that you wish to use to send out emails.
Note: There is no space between -f and your email id.
Update: The email Id that you mention above should be already existing within your CPanle account, otherwise the above settings will not work.
Tags: hostmonster, tweaks
June 5th, 2008 at 3:36 pm
This is excellent resource mate
Just Dugg it for ya, and will be Stumbling it after 
June 5th, 2008 at 3:48 pm
Thanks for the digg Devesh - Am glad you found it useful.
I’m sure others hosted on Host Monster will find this useful.
June 10th, 2008 at 12:47 pm
I have tried it before, but it seems no sense too….let me try again….
June 10th, 2008 at 12:50 pm
@GOVO - This worked absolutely fine for me. Are you following all the steps correctly?
June 10th, 2008 at 1:07 pm
The problem maybe the unexist email account under cpanel.
I have make a simple mail.php there, it work with phpmailer like wordpress, But no such a problem.
your can download it here and have a test, you will find the sender is what I want :
http://guitarbean.com/mail2.phpx
(PS: I rename the file to phpx inorder it can’t be run on my server)
June 10th, 2008 at 2:19 pm
@GOVO - If you dont have the email created in CPanel, the above steps wont work. So I’d suggest you create the email in CPanel, and then test. It should work.
June 10th, 2008 at 2:55 pm
Mybe, but I thing it is better to let it be….
June 10th, 2008 at 3:00 pm
If you’re happy getting the email from host#.hostmonster.com, you can let it be. The reason I changed the setting was so I & my readers get the email from my own mail ID.
June 10th, 2008 at 9:36 pm
Thanks. This is useful for me.
August 1st, 2008 at 4:04 pm
I am on HM and I have a WP installation. When some one writes a comment then the Author of the story was getting mails from shoppin8@hostmonster…… kind of address.
I changed that line in the ini file and made a comment on a story that was written by me. But I have not received a mail so far.
It may be that the mail would come after some time. I would wait till evening, few more hours, and then revert the change.
I hope i read this post correctly and doing the right thing. The new mail-id is present at cpanel but its not my login id (shoppin8 is my login though). When I say its present, I mean that I have configured that mail id under ‘E-mail accounts’.
August 1st, 2008 at 4:22 pm
@Nandan - Try publishing a new post, and then comment on the new post. I think from then onwards it will work. Doesnt work for existing posts. (I THINK - not sure)
August 1st, 2008 at 5:35 pm
Ok. I would try this for one of my other blogs as well and would get back on whether the above is true 100% or not.
I do not have a new travel story to share at ghumakkar
so it would need to wait for some time. I think it would hurt the old posts since the authors wont get the notification but I guess its a very nice solution in long term.
thanks again.
August 5th, 2008 at 5:21 pm
So I wrote a new one (read it in your spare time) , a story on Banaras and still the mails are from .hostmonster kind of address.
I read your post again and it was really dumb of me to not read well. I did change the php.ini file but that was at root of main domain. So i have now copied the same file at ghumakar blog root, and would wait to see the result.
August 5th, 2008 at 5:27 pm
It works. on old posts as well I guess. Great tip. and thanks for your comment.
August 5th, 2008 at 5:29 pm
Im glad it works for you
August 5th, 2008 at 5:35 pm
One more query.
The mail id which I have configured is called write@ghumakkar.com , when I receive the e-mail, the sender name is shown as ‘write’.
Can I change that to something more meaningful ?
I noticed that in your case, its your blog name.
August 5th, 2008 at 7:53 pm
I did think about that issue too - but didnt have time to explore it.
A quick workaround though could be if you save the email address in your address book with a meaningful name. When you get an email form write@ghumakar.com, it should display the meaningful name.
This will work in gmail - havent tried with any other service.
Hope that helps.
August 8th, 2008 at 3:07 pm
I spent some time on this. It seems that writing another parameter -F does the trick. Look at http://jhaji.blogspot.com for more details please.
August 11th, 2008 at 5:25 pm
Thanks Nandan, thats great