mail
(PHP 3, PHP 4 , PHP 5)
mail -- 送出郵件
Description
bool
mail ( string to, string subject, string message [, string additional_headers])
mail() 自動把
message 參數中的內容傳送到
to參數所指定的目的地去。 如要把訊息傳給許多人可以用逗號 分隔地址整句放到to中。
示範 1.傳送信件 mail("rasmus@lerdorf.on.ca", "My Subject", "Line 1\nLine 2\nLine 3"); |
|
第四個參數的內容會被加到標頭的緊後面, 它的作用是插入額外的標頭信息。 加入多個標頭可使用新行符號來把每個標頭分隔開。
示範 2.在送信時加入額外的標頭 mail("nobody@aol.com", "the subject", $message,
"From: webmaster@$SERVER_NAME\nReply-To: webmaster@$SERVER_NAME\nX-Mailer: PHP/" . phpversion()); |
|