|
|
|
วิถามวิธีแก้ปัญหา Host ส่งอีเมลเข้า hotmail ไม่ได้ แต่ส่งเข้า Gmail,yahoo ได้ปกติ |
|
|
|
|
|
|
|
ใช้ SMTP ของ Gmail ครับ ผมก็ใช้วิธีนี้เหมือนกันครับ
Code (PHP)
<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
</head>
<body>
<?php
require_once('class.phpmailer.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 = "mypassword"; // 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 & <b>My Description</b>";
$mail->AddAddress("[email protected]", "Mr.Adisorn Boonsong"); // 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
$mail->Send();
?>
</body>
</html>
Go to : PHP Sending Email Using Gmail Account Authentication
|
|
|
|
|
Date :
2011-06-10 12:36:49 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เจอปัญหา
SMTP Error: Could not connect to SMTP host.
ยังไม่ค่อยเข้าใจเรื่อง SMTP คับ
|
|
|
|
|
Date :
2011-06-10 16:33:41 |
By :
nammont |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|