[請益] Gmail SMTP php.ini 設定
小弟寫一個的PHP程式
是一個忘記密碼,補寄信件給會員的會員機制
但是一直出現警告,搞不定
請高手幫幫小弟吧
底下是程式碼的部分
$mailcontent ="您好,<br />您的帳號為:$username <br/>您的新密碼為:
$newpasswd <br/>";
$mailFrom="=?UTF-8?B?" . base64_encode("會員管理系統") . "?=
<www.test9727.com.tw>";
$mailto=$usermail;
$mailSubject="=?UTF-8?B?" . base64_encode("補寄密碼信"). "?=";
$mailHeader="From:".$mailFrom."\r\n";
$mailHeader.="Content-type:text/html;charset=UTF-8";
ini_set("SMTP","smtp.gamil.com");
mail($mailto,$mailSubject,$mailcontent,$mailHeader);
header("Location: admin_passmail.php?mailStats=1");
出現的警告
Warning: mail() [function.mail]: Failed to connect to mailserver at
"smtp.gamil.com" port 25, verify your "SMTP" and "smtp_port" setting in
php.ini or use ini_set() in C:\AppServ\www\phpmember\admin_passmail.php on
line 48
Warning: Cannot modify header information - headers already sent by (output
started at C:\AppServ\www\phpmember\admin_passmail.php:48) in
C:\AppServ\www\phpmember\admin_passmail.php on line 49
然後我試著去設定php.ini
以下是我修改過php.ini的部分
[mail function]
; For Win32 only.
SMTP = smtp.gmail.com
smtp_port = 465
; For Win32 only.
sendmail_from = gamestare@gmail.com
結果出現的警告還是一模一樣
還請各位高手幫忙
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.162.75.140
→
10/30 19:30, , 1F
10/30 19:30, 1F
→
10/30 19:31, , 2F
10/30 19:31, 2F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
PHP 近期熱門文章
PTT數位生活區 即時熱門文章