Why mails sent from my website has username@hostname as FROM address

The default behavior of Exim mail server is to use the cPanel username and hostname of the server to construct the envelope-sender address. 

Given below are the solutions to prevent email being user from user@myserver.hostname.com

1. Use PHP script to use SMTP AUTH
=========================
This is the best method to avoid mails being sent from username@hostname. If you can configure the mailer to use SMTP and authenticate with SMTP AUTH, this will set the correct "Return-Path" in the headers. 

2. Configure PHP script to use -f argument in PHP mail function
==========================================
Most applications that call the Exim/Sendmail binary will pass the -f switch along with the proper email address to prevent mails being sent from username@hostname.

You need to make sure that the application is using the 5th argument to the PHP mail() function to send the '-f' switch to sendmail so that it sets the correct "Return-Path". The -f argument should be used to set the envelope sender address when using sendmail with the -f sendmail option.

Please note that Crucial Paradigm tech support won't be able to assist with these changes in PHP scripts & customers need to contact a developer to make these changes in PHP scripts.
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to clear browser cache?

How to clear browser cache?Browser cache is a mechanism where the most frequently accessed sites,...

How to find out the name servers used by a domain?

Given below are few commands used to get information about the name-servers used by a domain.1....

How to reset MySQL Root Password?

Following steps can be used to reset MySQL root password:If you know the current root password...

I'm experiencing a network slow down or network issue, what should i do?

If you are experieincing a network issue, please first reset your modem and/or router and wait 10...

How to improve site perfomance?

In some cases website hosted in cPanel server (with Apache) loads very slowly. Here is a quick...

Powered by WHMCompleteSolution