-
-
Save maninthemirror/9a1af860e175030b50b5 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 =" yourmail@your.com "; //收件者 | |
$subject = "test"; //信件標題 | |
$msg = "smtp發信測試";//信件內容 | |
$headers = "From: admin@your.com"; //寄件者 | |
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