The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

wrong server in email

Discussion in 'E-mail Discussions' started by dotnetuk, Aug 3, 2011.

  1. dotnetuk

    dotnetuk Registered

    Aug 3, 2011
    Likes Received:
    Trophy Points:

    Hope some one can help here,

    Im having a small problem with emails that are being sent via PHP ( yes i tried php forums, no luck yet )

    I have setup so that when I sell a account a underconstruction landing page is automaticly set up for the client to use , I have used this code in it to send an email if some one go there and wants to know when the site will be up again etc.


    $mailTo = '';

    $mailFrom = htmlspecialchars($_POST['email']);

    $subject = 'Message from your site';

    $message = 'New Email: '.$mailFrom;

    mail($mailTo, $subject, $message);


    now, when I receive the email at my addess it tells me that it has come from, this isnt good as clients will know where I have my server etc, is there a way in CPANEL/WHM to set it say that it says its come from or clients domain if they have there own, (maybe a way to recode it to do it, I dont know)
    but that wouldnt solve the issue.
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Hello :)

    The default behavior of Exim is to use the cPanel username and hostname of the server to construct the envelope-sender address. Most applications that call the Exim/Sendmail binary will pass the -f switch along with the proper email address to keep that from happening.

    If you can configure the mailer to use SMTP and authenticate with SMTP AUTH, this will set the correct "Return-Path" in the headers. The other option is 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".

    Thank you.

Share This Page