Created
September 14, 2014 07:13
-
-
Save s9011514/4e1f478981b8a1d62912 to your computer and use it in GitHub Desktop.
[PHP]使用Mail函式透過SMTP發信
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$to =" [email protected] "; //收件者 | |
$subject = "test"; //信件標題 | |
$msg = "smtp發信測試";//信件內容 | |
$headers = "From: [email protected]"; //寄件者 | |
if(mail("$to", "$subject", "$msg", "$headers")): | |
echo "信件已經發送成功。";//寄信成功就會顯示的提示訊息 | |
else: | |
echo "信件發送失敗!";//寄信失敗顯示的錯誤訊息 | |
endif; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment