PDA

View Full Version : phpmailer bị lỗi khi chạy trên hosting - giúp đỡ gấp huhuh



sa01
02-01-2010, 00:38
em dùng thử cái phpmailer chạy dưới localhost thì ok. Nhưng em upload code lên hosting của godaddy hay CP2.APLUS.NET thì bị lỗi ko cho connect smtp là sao ta?
Message was not sent
Mailer Error: SMTP Error: could not connect to SMTP host server(s)

nội dung file mail của em:
Code:


<?php
require("class.phpmailer.php");
$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->Host = 'smtp.stgtechnologies.com';
$mailer->SMTPAuth = TRUE;
$mailer->Username = 'ad_timesheet@stgtechnologies.com';
$mailer->Password = ' '; // em bo pass ra vi ly do security
$mailer->From = 'ad_timesheet@stgtechnologies.com';
$mailer->FromName = 'admin time';
$mailer->IsHTML(true);
$bo='Dear All,<br> Please check the information of timesheet below to make sure it is correct! <br><br>';

$mailer->Body = $bo;
$mailer->Subject = 'This is html 2';
$mailer->AddAddress('san.le@synesii.com');
if(!$mailer->Send())
{
echo "Message was not sent<br/ >";
echo "Mailer Error: " . $mailer->ErrorInfo;
}
else
{
echo "Message has been sent";
}
?>



đây là link download 3 file source code của em:


1) class.phpmailer.php --
Code:

http://www.mediafire.com/?5z0zmtiwwc0

2) class.smtp.php --
Code:

http://www.mediafire.com/?jmwyionwndz

3) mail.php --
Code:

http://www.mediafire.com/?ymmlijztf12