HostMonster Web Hosting Help

Scripted E-mails appear to come from username@host###.HostMonster.com

Problem:

Why do scripted e-mails come from < username@host###.HostMonster.com > when I have specified otherwise?

Solution:

This is because our servers require you (or your script) to use a properly formatted, valid From: field in the email's header. If the From: field is not formatted correctly, empty or the email address does not exist in the cPanel, the From: address will be changed to username@host###.HostMonster.com.

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 will work
        From: "user" <user@domain.com>
Examples of headers that will NOT work:

From: "user@domain.com"
        From: user @ domain.com
        From: user@domain.com <user@domain.com>

Our servers will not accept the name for the email address and the email address to be the same. It will not accept a double declaration of the email address.

If you do not want to edit your PHP based scripts, you can modify the sendmail_path line located in your php.ini. You would want to modify it like this:

        sendmail_path = /usr/sbin/sendmail -t -i -f'user@domain.com'
        

The part that you will be adding is: -f'user@domain.com'

This method works because the php mail function calls sendmail (a program on the server) directly using the path defined in your php.ini. Placing the -f flag here allows us to work directly with sendmail without PHP getting in the way. Passing a "From" header to the php mail function will override the -f flag set in your php.ini.

For scripts such as Joomla and Wordpress, you will need to follow their documentation for formatting the from fields properly.

Note: The email address you use must be a valid created account in the cPanel.

Knowledgebase Article 219,323 views bookmark tags: email forms header php script scripted sendmail (updated 47 days ago)


Was this resource helpful?

Did this resolve your issue?


Please add any other comments or suggestions about this content:





Recommended Help Content

How do I display the Internet email header? (updated 517 days ago)
Knowledgebase Article 225,996 views tags: email header mail

With support for FrontPage extensions now gone you may want to find alternatives to email forms and the counters that are native to front page. This article explains some ways to replace the forms and hit counters. (updated 120 days ago)
Knowledgebase Article 3,275 views tags: alternatives counters forms frontpage mail

How do I redirect users to another page using PHP? (updated 1791 days ago)
Knowledgebase Article 100,105 views tags: header php redirect redirects

Related Help Content

The most common cause is that you are either sending to or sending from an invalid email address. You will want to create a new email address, and change your profile to use a different Email address. (updated 2161 days ago)
Knowledgebase Article 78,329 views tags: email fantastico php phpbb sending

Email spoofing is when someone modifies the email header's "From:" line to be whatever they would like. (updated 1350 days ago)
Knowledgebase Article 105,381 views tags: email spoof spoofing

We need to execute a Perl script from inside a PHP page and display the results as part of the page. We tried the 'virtual' command but the server returns: blank. (updated 2156 days ago)
Knowledgebase Article 57,633 views tags: perl script

I'm trying to configure an application (phpList) and it requires that I enter (in config.php) a username and password for a POP3 account to handle bounces. I keep getting a POP3 error and it can't log (updated 2168 days ago)
Knowledgebase Article 72,548 views tags: list mail php phplist

Script executed with a cron job requires a specific php.ini file to be used. (updated 940 days ago)
Knowledgebase Article 79,172 views tags: command cron cronjob crontab custom line optimizer php zend

Understanding Internet email headers. (updated 517 days ago)
Knowledgebase Article 86,690 views tags: email header ip

Can I change my username after registration? (updated 2143 days ago)
Knowledgebase Article 81,876 views tags: change username

Formmail from Matt's Script Archive will not send from an email address other than my main HostMonster account. (updated 1827 days ago)
Knowledgebase Article 75,449 views tags: email