Using the PHP Mail Function with Additional Headers

No Comments
Tags: , ,
Posted 07 Feb 2010 in php

Pass a fourth parameter to the mail() function with the header information.

<?php
$to = "jane@example.com";
$subject = "Hello World!";
$body = "This will be sent from email-addr@example.com";
$headers = "From: email-addr@example.com\r\nX-Mailer: php";
mail($to, $subject, $body, $headers);

Related posts:

  1. Send Mail in Ruby with a Pony
  2. Updating Your Twitter Status with cURL and a Bash Function
  3. Using sendmail to send mail on ubuntu box
  4. Generate MySQL Datetime Type Using PHP Date() Function

Add Your Comment