|
 |
|
สอบถามเรื่องการส่ง Email PHPmailer ของ Gmail ครับผม ช่วยหน่อยครับ |
|
 |
|
|
 |
 |
|
Code (PHP)
<?php
require_once('../phpmailer/phpmailer.inc.php');
//require_once('../phpmailer/smtp.inc.php');
$mail = new PHPMailer();
$mail->IsHTML(true);
$mail->IsSMTP();
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "[email protected]"; // GMAIL username
$mail->Password = "xxxxxxx"; // GMAIL password ใส่แล้วนะครับ
$mail->From = "[email protected]"; // "[email protected]";
//$mail->AddReplyTo = "[email protected]"; // Reply
$mail->FromName = "Mr.Weerachai Nukitram"; // set from Name
$mail->Subject = "Test sending mail.";
$mail->Body = "My Body";
$mail->AddAddress("[email protected]"); // to Address
//$mail->AddAttachment("thaicreate/myfile.zip");
//$mail->AddAttachment("thaicreate/myfile2.zip");
//$mail->AddCC("[email protected]", "Mr.Member ShotDev"); //CC
//$mail->AddBCC("[email protected]", "Mr.Member ShotDev"); //CC
//$mail->set('X-Priority', '1'); //Priority 1 = High, 3 = Normal, 5 = low
if($mail->Send()){
echo "OK" ;
}else{
echo"fail";
}
?>
ได้ fail ตลอดเลยครับ ผมลองทำตามที่นี่แนะนำอะครับงงมากกก
แล้วถ้าผมเปิด บรรทัด //$mail->set('X-Priority', '1'); //Priority 1 = High, 3 = Normal, 5 = low
มันจะขึ้น Fatal error: Call to undefined method phpmailer::set() in C:\AppServ\www\phpmydream\ex18-1\frd.php on line 23
แต่ถ้าปิดไว้จะขึ้น fail ครับ
Tag : PHP, HTML/CSS, JavaScript, VBScript, Ajax

|
|
 |
 |
 |
 |
Date :
2011-09-17 03:44:59 |
By :
pokin |
View :
1964 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วนะครับผม แก้จนได้ตอน 7.12 - -*
ผมพลาดตรง PHPmailer เหมือนตัวที่ผมโหลดมาใช้มันจะไม่สมบูรณ์อะไรสักอย่าง พอโหลดตัวใหม่มาแก้นิดหน่อยใช้ได้เลย
ไปนอนละครับพี่น้องzzzzz
|
 |
 |
 |
 |
Date :
2011-09-17 07:14:03 |
By :
pokin |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
server ที่ connect อินเตอร์เน็ตผ่าน proxy จะทำยังไงให้มันส่งได้ครับ
แต่ถ้าไม่ผ่าน proxy ก็ส่งได้ปกติครับ
|
 |
 |
 |
 |
Date :
2012-05-28 16:47:47 |
By :
poomloom |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
น่าจะติดพวก Firewall / Proxy ของ Network ครับ
|
 |
 |
 |
 |
Date :
2012-05-28 20:16:21 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|