send-email-with-headers.php : mail « Utility Function « PHP






send-email-with-headers.php

 
<?php
    $headers = "From:sender@example.com\r\n";
    $headers .= "Reply-To:sender@example.com\r\n";
    $headers .= "Content-Type: text/plain;\r\n charset=iso-8859-1\r\n";

    mail("test@example.com", "This is the subject", 
         "This is the mail body", $headers);
?>
  
  








Related examples in the same category

1.Add both name and address values into the email address
2.mail() function mails information to a given recipient.
3.mail-javascript.php
4.Using mail() to redirect user information
5.Encrypting and Sending Secure Emails Using S/MIME
6.send-email-multiple-recipients-2.php
7.send-mail-multiple-recipients.php
8.send-plaintext-email.php
9.Sending user-requested information
10.Sends a HTML mail from a given email address:
11.Sending Internet Mail
12.Sending Mail
13.Sending a message with mail()