邮件不发送也没有错误

时间:2013-09-21 12:05:11

标签: php phpmailer

我正在尝试发送测试邮件,但无法获得任何输出。

这是我的完整代码。

<?php
try
{

require_once('C:/wamp/bin/php/php5.4.16/class.phpmailer.php');<br/>
echo "Started";<br/>


$mail = new PHPMailer();<br/>

echo "Instance Created<br/>";<br/>

$mail->IsSMTP();<br/>
$mail->Host = "smtpout.secureserver.net";<br/>
$mail->SMTPDebug=1;<br/>

$body="<h1> Testing 123</h1>";<br/>

$mail->SMTPAuth = true;<br/>
$mail->Host = "smtpout.secureserver.net";<br/>
$mail->Port = 80;<br/>

$mail->Username ="****";<br/>
$mail->Password="****";<br/>

$mail->SetFrom('*****', '***');<br/>
$mail->AddReplyTo('****', '***');<br/>

$mail->Subject    = "PHPMailer Test Subject via POP before SMTP, basic";<br/>
$mail->AltBody ="Please enable html on your viewr";<br/>

echo "Loaded";<br/>
$mail->MsgHTML($body);<br/>

$address = "****";<br/>
$mail->AddAddress($address, "***");<br/>

print_r($mail);<br/>

echo "Sending";<br/>

if(!$mail->Send()) {<br/>
echo "mailer info";<br/>
    echo "Mailer Error: " . $mail->ErrorInfo;<br/>
} else {<br/>
echo "Message sent!";<br/>
}<br/>
echo "Code End";<br/>
}<br/>
catch (phpmailerException $e) {<br/>
  echo $e->errorMessage(); //error messages from PHPMailer<br/>
} catch (Exception $e) {<br/>
  echo $e->getMessage();<br/>
}<br/>
?><br/>

输出结果为:

Started<br/>
Instance Created<br/>
Loaded<br/>
PHPMailer Object ( [Priority] => 3 [CharSet] => iso-8859-1 [ContentType] => text/html [Encoding] => 8bit [ErrorInfo] => [From] => santhosh.kumar@ruralshores.com [FromName] => Santosh [Sender] => santhosh.kumar@ruralshores.com [Subject] => PHPMailer Test Subject via POP before SMTP, basic [Body] =><br/>
Testing 123<br/>

[AltBody] => Please enable html on your viewr [WordWrap] => 0 [Mailer] => smtp [Sendmail] => /usr/sbin/sendmail [PluginDir] => [ConfirmReadingTo] => [Hostname] => [MessageID] => [Host] => smtpout.secureserver.net [Port] => 80 [Helo] => [SMTPSecure] => [SMTPAuth] => 1 [Username] => santhosh.kumar@ruralshores.com [Password] => RS2008 [Timeout] => 10 [SMTPDebug] => 1 [SMTPKeepAlive] => [SingleTo] => [SingleToArray] => Array ( ) [LE] => [DKIM_selector] => phpmailer [DKIM_identity] => [DKIM_domain] => [DKIM_private] => [action_function] => [Version] => 5.1 [smtp:PHPMailer:private] => [to:PHPMailer:private] => Array ( [0] => Array ( [0] => sridhara.santoshkumar@gmail.com [1] => Santosh ) ) [cc:PHPMailer:private] => Array ( ) [bcc:PHPMailer:private] => Array ( ) [ReplyTo:PHPMailer:private] => Array ( [santhosh.kumar@ruralshores.com] => Array ( [0] => santhosh.kumar@ruralshores.com [1] => Santosh ) ) [all_recipients:PHPMailer:private] => Array ( [sridhara.santoshkumar@gmail.com] => 1 ) [attachment:PHPMailer:private] => Array ( ) [CustomHeader:PHPMailer:private] => Array ( ) [message_type:PHPMailer:private] => [boundary:PHPMailer:private] => Array ( ) [language:protected] => Array ( ) [error_count:PHPMailer:private] => 0 [sign_cert_file:PHPMailer:private] => [sign_key_file:PHPMailer:private] => [sign_key_pass:PHPMailer:private] => [exceptions:PHPMailer:private] => ) <br/>Sending

没有邮件正在发送且没有显示错误?

0 个答案:

没有答案