2007/Jun/16

Platform: Microsoft Windows XP
Programming language: PHP
Web server: IIS
ปัญหา: ไม่สามารถส่ง mail ใน PHP

มีสาวน่ารัก มาปรึกษาว่าทำไมส่ง mail ด้วย function mail ไม่ได้ (ตั้งนานแล้วเพิ่งจะ update)
ก็เลยเอามาลองที่เครื่อง ปรากฎว่าขึ้น error เป็น
"Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for ..."

วิธีแก้ก็คือ
1. เปิด Control Panel เลือก Administrative Tools
2. เลืิอก Internet Information Services
3. เลือก [Local computer]
4. click ขวา ที่ Default SMTP Virtual Server เลือก Properties
5. เลือก tab Access
6. ที่ Relay Restrictions, click ที่ Relay แล้ว click Add
7. เลือก Single Computer แล้วใส่ IP address เป็น 127.0.0.1

แต่สุดท้ายก็แก้ปัญหาให้สาวผู้น่ารักไม่ได้ เพราะสาวเจ้าใช้ Web server เป็น Apache
ซึ่งพยายามลง Apache แ้ล้วก็ไม่สำเร็จ แต่ลง Appserv ได้ -_-"

ชื่อ: 
เว็บไซต์: 
คอมเมนต์:




smilebig smileopen-mounthed smileconfused smilesad smileangry smiletonguequestionembarrassedsurprised smilewinkdouble winkcry
แล้วถ้ามานขึ้นว่า
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
จะแก้ได้ยังไงค่ะ
#1  by  St.Whirlwind At 2007-07-18 12:04, 
ต้องลองดูสิครับว่า SMTP ได้เปิดไว้หรือยัง
ถ้าเป็นบน Windows ลองดูที่ IIS มันจะมี Default SMTP Virtual Server
ถ้าเปิดแล้วลองดูในไฟล์ php.ini ว่า set ตัวแปร SMTP กับ smtp_port ไว้หรือยัง
SMTP = localhost
smtp_port = 25
#2  by  Gaiz At 2007-07-25 00:16, 
ขอบคุณครับ
#3  by  สัน (125.24.51.135) At 2008-02-20 14:04, 
ขอบคุณครับ
#4  by  มือใหม่หัดเขียน php (117.47.171.193) At 2008-11-09 08:11, 
ถ้าแบบนี้ละคับ ขอบคุณล่วงหน้าคับ
Warning: mail() [function.mail]: SMTP server response: 554 User unknown in C:\AppServ\www\osc\includes\classes\email.php on line 522

Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\osc\includes\classes\email.php:522) in C:\AppServ\www\osc\includes\functions\general.php on line 33
#5  by   (125.26.189.245) At 2009-09-19 13:03, 

<< Home