Warning: fsockopen() [function.fsockopen]: no SSL support in this build in C:\Inetpub\vhosts\myhost.com\httpdocs\test\php\phpmailer\class.smtp.php on line 105
Warning: fsockopen() [function.fsockopen]: unable to connect to smtp.gmail.com:465 in C:\Inetpub\vhosts\myhost.com\httpdocs\test\php\phpmailer\class.smtp.php on line 105
Line 113 >> public function Connect($host, $port = 0, $tval = 30) {
Line 114 >> // set the error val to null so there is no confusion
Line 115 >> $host ="ssl://smtp.gmail.com";
Line 116 >> $port = 465;
Line 117 >>
Line 118 >> $this->error = null;
Line 119 >>
Line 120 >>
...
ลองแก้ดูแล้วแต่ยังส่งไม่ได้เลยครับ...
SMTP Error: Could not connect to SMTP host.
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>
เกิดจากไม่สามารถเชื่อมต่อไปยัง SMTP ของ GMail ได้น่ะครับ ลอง Upload ขึ้น Web Host Server จริง ๆ ไม่น่าจะมีปัญหาครับ
Date :
2011-03-11 17:47:53
By :
webmaster
No. 5
Guest
เจอปัญหานี้เหมือนกันค่ะ
อัพโหลดไปที่ Server แล้ว
แต่ส่งเมลล์ไม่ได้
Warning: fsockopen() [function.fsockopen]: SSL: connection timeout in /xxx/phpmailer_gmail/class.smtp.php on line 105
Warning: fsockopen() [function.fsockopen]: Failed to enable crypto in /xxx/phpmailer_gmail/class.smtp.php on line 105
Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Unknown error) in /xxx/phpmailer_gmail/class.smtp.php on line 105