我使用的是:PHPMailer 来发送邮件
<?php
$arr = array(
'email' => '123456@qq.com',
'title' => 'new',
'body' => 'net fsadfafd'
);
ini_set('display_errors','On');
error_reporting(E_ALL);
var_dump(smtp_mail($arr));
function smtp_mail ( $data = array() ) {
require("./class.smtp.php");
require("./class.phpmailer.php");
if (!$data) return false;
$mail = new PHPMailer(true);
$mail->IsSMTP(); // send via SMTP
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->SMTPSecure = "ssl";
$mail->Host = '199.175.49.209';//"67.23.190.123"; // SMTP servers
$mail->Port=587;
$mail->Username = 'support@leawo.com';//"contact@app.com"; // SMTP username 注意:普通邮件认证不需要加 @域名"contact@app.com"
$mail->Password = '123456';//"123456"; // SMTP password"123456"
$mail->From = 'support@leawo.com';//'contact@app.com'; // 发件人邮箱
$mail->FromName = 'support@leawo.com'; // 发件人
$mail->CharSet = "utf-8";//"GB2312"; // 这里指定字符集!
$mail->Encoding = "base64";
$mail->AddAddress($data['email'],$data['email']); // 收件人邮箱和姓名
$mail->IsHTML(true); // send as HTML
$mail->Subject = $data['title']; // 邮件主题
$mail->Body = $data['body']; // 邮件内容
$mail->AltBody ="text/html";
$mail->SMTPDebug = 4;
$t = $mail->send();
var_dump($t);
return $point_out;
}
把上面的邮箱换成gmail. yahoo.com都能正常发送,换成iredmail就不行了,求高人指点