sendmail
sendmail
SYNOPSIS
function sendmail($to, $subject, $body, $headers, $sender)
DESCRIPTION
sendmail sends an email with the PHP function mail using the option -f to set the SMTP envelope sender to $sender.
Using the -f option allows the envelope sender to match the sender domain, which is required by SPF on many mail servers.
IMPORTANT: The DNS of the domain of $sender must publish an SPF record authorizing the IP address of the SMTP server which sends the emails.
CODE
- function sendmail($to, $subject, $body, $headers, $sender) {
- // add the -f option so the SMTP MAIL FROM address can be used by SPF authentication
- return @mail($to, $subject, $body, $headers, '-f' . $sender);
- }
Comments