[請益] MAIL 問題

看板PHP作者 (CAnthony)時間16年前 (2010/01/25 12:31), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
===============mail_form.php <html> <head> <title>郵寄表單</title> </head> <body> <form action="send_mail.php" method="post"> 收件人Email:<input type="text" name="mail2who"><br> <!--寄件人Email:<input type="text" name="mailheader"><br>--> 郵件主題:<input type="text" name="mail_title"><br> 郵件內容:<textarea name="mail_content" rows="5" cols="40"></textarea><br> <input type="submit" value="寄出"> </form> </body> </html> ================send_mail.php <?php mail($_POST['mail2who'],$_POST['mail_title'],$_POST['mail_content']); echo "已經寄出給{$_POST['mail2who']}囉!"; ?> ================php.ini內部設定 [mail function] ; For Win32 only. ;[修改]將SMTP伺服器的位址指向gmail的SMPT伺服器位址 SMTP = msa.hinet.net smtp_port = 25 ; For Win32 only. ;[修改]寄件者設定為canthony015@gmail.com sendmail_from = canthony015@gmail.com ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ;sendmail_path = ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = ================出現的問題 Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\AppServ\www\canthony\mail\send_mail.php on line 2 ================相關資訊 我的OS是 : WINDOWS 7 用的是==> appserv 2.5.10 網路 ==> Hinet 2M 爬過文!! 但是還是找不出問題原因= = 所以想請大家幫幫忙:) 感謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.229.91.137

01/27 23:03, , 1F
建議用 phpmailer 比較快~
01/27 23:03, 1F
文章代碼(AID): #1BNHwDf3 (PHP)
文章代碼(AID): #1BNHwDf3 (PHP)