$to = "test@mail.net.tw";//收件者 $subject = "My HTML email test.";//主旨 $headers = "From: test@mail.net\r\n";//寄件者 $headers .= "Cc: test@msa.hinet.net\r\n";//副本 $headers .= "Bcc: test@mail.net\r\n";//密件副本 $headers .= "Reply-To: test@mail.net\r\n";//指定收件者回覆時的預設的信箱 $headers .= "Return-Path: test@mail.net\r\n";//如無設定有時會被mail server 檔下 //信件格式 $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; //信件內容 $message = "<html><body>"; $message .= "php <strong>信件發送</strong>"; $message .= "</body></html>"; if (mail($to, $subject, $message, $headers)) { echo "信件已寄出"; } else { echo "信件發送失敗!"; }
PHP mail() 發送
週三, 2011-08-31 16:55
#1
PHP mail() 發送
週三, 2012-10-17 08:25
#2
mail 發送含附加檔案
http://blog.roodo.com/linpapa/archives/10000107.html
from