 |
|
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 :
1983 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |