Scripted Emails Appear to Come from username at myserver
If you are using assistive technology and are unable to read any part of the HostMonster website, or otherwise have difficulties using the HostMonster website, please call 866-573-HOST and our customer service team will assist you.
Skip to main content

HostMonster Web Hosting Help

Scripted Emails Appear to Come from username at myserver

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 469,924 views bookmark tags: email forms header php script scripted sendmail


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 redirect users to another page using PHP?
Knowledgebase Article 936,205 views tags: header location php redirect redirects

How do I display the Internet email header?
Knowledgebase Article 547,462 views tags: email header mail

Understanding Internet email headers.
Knowledgebase Article 315,288 views tags: email full header ip partial

Related Help Content

There are a large number of emails or spam that need to be deleted from an email account.
Knowledgebase Article 322,457 views tags: delete email emails empty inbox spam trash

Trying to send out emails from multiple email accounts fail from both webmail and third party email clients. Possible Reasons: The maximum emails per hour has been exceeded. This can be caused by forw
Knowledgebase Article 591,477 views tags: email exceeded mailbox outlook quota receive receiving send sender unable

Script executed with a cron job requires a specific php.ini file to be used.
Knowledgebase Article 226,499 views tags: command cron cronjob crontab custom line optimizer php zend

Can't receive emails? Here are a few things to try.
Knowledgebase Article 198,130 views tags: email troubleshooting

I get the following database connection error: Warning: mysql_connect() [function.mysql-connect]: Host 'host#.HostMonster.com' is blocked because of many connection errors; unblock with 'mysqlad
Knowledgebase Article 266,828 views tags: blocked connection host localhost mysql

In the newer versions of PHP, they have included a new directive to control and handle remote includes. We disable this option, by default, which may affect some of your PHP scripts.
Knowledgebase Article 182,416 views tags: include php remote url

This article will explain how to add a PHP handler to your .htaccess files. This is useful if you want to customize the version of PHP that runs your PHP files.
Knowledgebase Article 408,493 views tags: htaccess php

500 Internal Server Error when installing via the MOJO Marketplace installer.
Knowledgebase Article 285,138 views tags: cpanel errors htaccess panel php script simpel

This site utilizes JavaScript to function correctly. Looks like it's disabled on your browser. Please enable it for your best experience.

For instructions on enabling JavaScript, click here