Ad Widget

Collapse

No envelope sender header in e-mail notification

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Netbulae
    Junior Member
    • Jul 2009
    • 27

    #1

    No envelope sender header in e-mail notification

    Hi,

    I noticed the From address for notifications is set in the
    but e-mail is still sent as "[email protected]".

    This because there is no envelope sender header and the notifications could be classified as spam because of this. We have it a lot with websites.

    Maybe it's better to include the envelope sender header:



    Additionally, with many PHP installations with Apache servers that have a default sendmail or postfix configurations, the way that mail() and PHP communication with the local MTA causes the SMTP "envelope sender" to usually be apache@hostname - where hostname is the actual DNS server name that sits behind any given virtual host. The "envelope sender" is the address listed in the "Return-Path:" header - and controls where the email is sent to in the event that a recipient address bounces.

    Because of this "envelope sender" issue, perhaps the most important best practice in this code snippet is the addition of the $mailParams part of the mail() function.

    This addition forces PHP to set the "envelope sender" (or the Return-Path: header) to the address you specify.
Working...