As many of you know that I had changed my hosting provider to HostMonster a few months back (it’s been great so far and no complaints). I was doing a little testing after I had installed the WP Thread Comment plugin and found that the sender email does not work properly. Emails received would have username@host.hostmonster.com shown in the header as the sender. Really did not want the recipients of the messages to see that!
I had previously inquired about this issue with support and they had suggested the following solution:
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 the email address doesn’t exist on our server, the from address will be changed to <username>@<host#>.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: <user@domain.com>
From: “name” <user@domain.com>Examples of headers that will NOT work:
From: “user@domain.com”
From: user @ domain.comAlternative for PHP Users:
– You can also modify which account should be used when sending out using the mail() function. Inside the local php.ini file, you will find a line of code that looks something like this (around line 601):sendmail_from = mail@yourdomain.com
Be sure to uncomment this by deleting the ‘;’ before the directive. Also, the account you use must be a valid created account.
The above had worked for my other script so there I went editing php.ini, however, I was far from succeeding. Yes, WordPress is just fussy!
Sent a lengthy support ticket regarding issue and a response was received within 1/2 hour (customer service is fast here, happy that that). After a few replies (the usual confirmation that the suggested was used and testing on their end), a L2 representative had insisted that the issue was script-based. He indicated that the setting must be changed via WordPress. :?: I had looked high and low through the admin section and did not see such a setting. Unsatisfied and determined, I went off searching and found a wonderful solution. Here it is:
Rather than using
sendmail_from = mail@yourdomain.com
use
sendmail_path = /usr/sbin/sendmail -t -i -fusername@domain.com
-f is the command option, followed by the actual email address you would like to use. There are no space between -f and your email address.
Please also be sure that the email addy that you are using already exist on the account, it can be created through your cPanel under the Mail section.
I had also send a little FYI to the support team. Hopefully, they will acknowledge the solution and assist other customers with the same issue rather than blaming it on WordPress.
Possibly Related Posts:
- New layout for September
- New Layout and 3 Day Countdown to MatsuJun’s Birthday
- Happy April, New Layout
- New layout
- Upgrading to WordPress 2.7 killed my permalinks