PHP email

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • paulmc
    New Member
    • Aug 2011
    • 4

    PHP email

    Hi All,

    My email function creates a multipart message, which sends fine.

    In the mail function i am passing in:

    to
    message
    headers
    '-f' . from


    I believe the '-f' is meant to suppress the servers email address, but it isnt.

    My question is, how to i suppress the servers email being presented as it states SERVER_EMAIL on behalf of MY_EMAIL
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    in the headers add "From: your@email.com" or "From: First Last <your@email.com >".

    See the manual: http://php.net/mail

    Dan

    Comment

    • paulmc
      New Member
      • Aug 2011
      • 4

      #3
      Hi Dan,

      Thanks for the response. My current headers are as follows:
      Code:
      $headers .= "To: " . $to . " <" . $to . ">\r\n";
      $headers .= "From: " . $from . " <" . $from . ">\r\n";
      $headers  = 'MIME-Version: 1.0' . "\r\n";
      $headers .= 'Sender:' . $from . "\r\n";
      $header = "Content-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\"";

      Comment

      Working...