發送mail 索取回條

回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

發送mail 索取回條

文章 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";
?>
回覆文章

回到「PHP」