Friday, August 08, 2008

Setting a meaningful WP sender e-mail

I have a blog which is hosted on Wordpress. Its a travel blog and I wanted that Authors be notified when a new comment is made on any of their posts. So I did the relevant settings but funnily the sender e-mail id is host#.hostmonster.com. I have taken the hosting from Hostmonster.com.

This was my first experience with a website so I sort of let it go. Once the site was old and I had more information and time, I started looking for a solution. I found the solution here

http://riteshsapra.net/wp/2008/06/05/wordpress-sender-email-incorrect-hostmonster/

and it worked. In a nutshell the solution is
1. Look for a file called php.ini. Its usually on the root
2. Look for a following command and add -f option followed by e-mail id.

sendmail_path = /usr/sbin/sendmail -t -i -fusername@domain.com

3. Copy this file to WP blog root.

You need to ensure that the e-mail id which you are using is correctly configured in cpanel.

This did solve the initial problem. Now users were getting e-mail from a relevant id. But still it was not looking very elegant as there was no sender name. I wanted to see if there could be a way where I can set a 'Sender' name instead of an e-mail ID.

I asked Ritesh and he was not aware so I did some research and buoyed by the initial success after Reading Ritesh's article, I found a solution.

I did following

sendmail_path = /usr/sbin/sendmail -t -i -fusername@domain.com -FfromGhumakkar

I was expecting that it would set the Sender name as 'From Ghumakkar' but WP actually now setting the real commenter as the sender, which is all the good.

If its useful to you then do write a small comment.

2 comments:

Ritesh Sapra said...

Hey great !!!

I'll try this on my blog too...

Thanks :-)

Nandan Jha said...

Sure. I dont want to try too many settings ;) since its a fairly active site but I guess one can really do many things.

It all started because of your blog so thanks once again :)