Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

how to change default sender address while using mail() function in PHP ?

Discussion in 'E-mail Discussion' started by navid120, Apr 28, 2011.

  1. navid120

    navid120 Member

    Joined:
    Apr 23, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    while I use mail() function to send emails, my sender address is a default address that I want to change it to some else like no-reply@MyDomain.com , I think it must be in 'sendmail' file that I can not find . where can I find it or where is usr/bin/sendmail path?
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,230
    Likes Received:
    1,938
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice