[請益] 寄信問題
我想用php寄信
因為是把php放在系上空間,不能改php.ini所以加入ini_set
function SendTestMail($Subject, $Content, $MailTo) {
ini_set("SMTP","mail.ee.nchu.edu.tw");
ini_set("sendmail_from","49664013@mail.ee.nchu.edu.tw");
ini_set("smtp_port", "25");
$result=mail($MailTo, $Subject, $Content);
echo $result;
}
$Subject= "email test from slackware.tw";
$MailTo = "stephen771015@gmail.com";
$Content= "test by PHP";
SendTestMail($Subject, $Content, $MailTo);
?>
卻出現
Warning: mail(): SMTP server response: 553 sorry, you don't authenticate or
the domain isn't in the list of allowed rcpthosts in f:\ftp\49664013\public_html\test.php on line 7
這是不是說需要登入才可以寄信
可否告訴我要如何修改呢,以及要插入在哪裡
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.120.228.46
PHP 近期熱門文章
PTT數位生活區 即時熱門文章