1 頁 (共 1 頁)

發送mail 索取回條

發表於 : 2007-08-13 10:55:53
yehlu
<?php
$fromname = "From Name";
$frommail = "name@from.mail";
$toname = "TO Name";
$tomail = "name@to.mail";

$headers .= "From: $fromname<$frommail>\n";
$headers .= "To: $toname <$tomail>\n";
$headers .= "Return-Path: <$frommail>\n"; //Return bouned mails to.
$headers .= "X-Priority: 1\n"; //Message priority is set to HIGH
$headers .= "X-MSMail-Priority: High\n"; //Message Priority for Exchange Servers
$headers .= "Disposition-Notification-To: $fromname<$frommail>\n"; //Read receipt
$headers .= "X-Confirm-Reading-To: fromname<$frommail>\n";
$headers .= "X-Mailer: PHP(".$_SERVER['REMOTE_ADDR'].")\n"; //IP address of who sent the mail.

$email = $tomail; // Recipients anddress
$subject = "Some Subject"; // Subject

$now = date("Y-m-d H:i:s");

$message .= "Dear Friend,\n\n"; // Email body
$message .= "Please stop by and visit http://www.phpfreaks.com to learn about PHP!\n\n";
$message .= "Thanks for your time,\n";
$message .= "Your Name $now \n";


mail($email, $subject, $message, $headers);

//echo $now ."send";
?>