สอบถามเรื่อง การส่งเมลล์ด้วย phpmailer

<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 = 587; // set the SMTP port for the GMAIL server

$mail->Username = "xxxxxxxx@gmail.com"; // GMAIL username

$mail->Password = "xxxxxxxxxxxx"; // GMAIL password

$mail->From = "xxxxxxxxxx@gmail.com"; // "name@yourdomain.com";

//$mail->AddReplyTo = "support@thaicreate.com"; // Reply

$mail->FromName = "kwang"; // set from Name

$mail->Subject = "Test sending mail.";

$mail->Body = "My Body & <b>My Description</b>";



$mail->AddAddress("info@xxxxxxxxxxx.com", "chiangmai"); // to Address



$mail->AddAttachment("thaicreate/myfile.zip");

$mail->AddAttachment("thaicreate/myfile2.zip");



//$mail->AddCC("member@thaicreate.com", "Mr.Member ShotDev"); //CC

//$mail->AddBCC("member@thaicreate.com", "Mr.Member ShotDev"); //CC



//$mail->set('X-Priority', '1'); //Priority 1 = High, 3 = Normal, 5 = low



if(!$mail->Send()) {

echo "Mailer Error: " . $mail->ErrorInfo;

} else {

echo "Message sent!";

}

?>

</body>

</html>





ขอถามอีกครั้งค่ะ



มันติดเออเรอตรงนี้อะค่ะ



Mailer Error: Language string failed to load: from_failedxxxxxx@gmail.com



ตรงบรรทัดนี้ค่ะ $mail->From = "xxxxxxxxxx@gmail.com"; // "name@yourdomain.com";
01 มี.ค. 2554 6 11,760

Error นี้ไม่เคยเจอเลยครับ อาจมีปัญหาเกี่ยวกับอักขระนะครับ ซึ่งควรเป็น UTF-8
#1

พอแก้ เออเรอนี้ได้ แต่มาติดเออเรอตรงนี้อีกค่ะ



SMTP Error: Could not connect to SMTP host. Mailer Error: SMTP Error: Could not connect to SMTP host.



มันส่งจากเครื่องไปได้นะค่ะ  แต่พออัพขึ้นไปลองบนโฮส มันติดเออเรอ แบบข้างบนนนี้ค่ะ
#2


ไม่สามารถติดต่อกับ mail server ได้...



อาจเกิดจาก Server ที่ใช้อยู่ไม่รองรับการส่งเมล์

หรือไม่ก็กำหนดค่า mail server ผิด

หรือไม่ก็ Server ส่งเมล์ได้ แต่ไม่รองรับ relay mode (โหมดนี้ Server จะยอมให้ส่งเมล์ผ่าน Mailserver อื่นได้)


#3


รองทดสอบกับ ArgoSoft Mail Server ดูสิครับก่อนลงเครื่องจริง


#4


<html>


<body>


<?php


$header = "From: yyy@gmail.com";


$txt = "Hello World";


$txt = wordwrap($txt,70);


mail("xxx@hotmail.com","My subject",$txt,$header);


?>


</body>


</html>



โค้ดตามนี้ครับ ขึ้น Error==>Warning: mail() [function.mail]: SMTP server response: 553 We do not relay non-local mail, sorry. in C:\xampp\htdocs\Testmail.php on line 7


ช่วยทีครับขอด่วน ส่งพรุ่งนี้แล้วคับ!

ติดต่อมาได้ทาง E-mail เลยครับ 

#5

555+++



ไม่สามารถส่งเมล์จาก localhost ได้ครับ



อ่านบทความครับ หากต้องการส่ง เมล์
#6
ความคิดเห็น
ไฟล์อัปโหลด ชนิด jpg, jpeg ขนาดไฟล์ไม่เกิน 1024
^