Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Yahoo smtp没有发送邮件,但相同的代码在gmail上运行良好。需要帮助。在本地服务器上工作_Php_Smtp_Phpmailer - Fatal编程技术网

Php Yahoo smtp没有发送邮件,但相同的代码在gmail上运行良好。需要帮助。在本地服务器上工作

Php Yahoo smtp没有发送邮件,但相同的代码在gmail上运行良好。需要帮助。在本地服务器上工作,php,smtp,phpmailer,Php,Smtp,Phpmailer,雅虎SMTP邮件的示例代码 这段代码在Gmail上正常工作,但在雅虎上却没有显示 SMTP -> ERROR: Failed to connect to server: (0) SMTP Error: Could not connect to SMTP host. Message has been sent....... with port no 465 SMTP -> ERROR: MAIL not accepted from server: 501 Syn

雅虎SMTP邮件的示例代码

这段代码在Gmail上正常工作,但在雅虎上却没有显示

SMTP -> ERROR: Failed           to connect to server: (0) 
SMTP Error: Could not connect to SMTP host. Message has been sent.......

with port no 465
SMTP -> ERROR: MAIL not accepted from server: 501 Syntax error in arguments 

The following From address failed: root@localhost Message has been sent.......


<?php
include('class.phpmailer.php');
include('class.smtp.php');
try {
$mail = new PHPMailer();  
$mail->IsHTML(true);
$mail->SMTPDebug  = 1;
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.mail.yahoo.com"; //smtp host
$mail->Port = 25; //port no.
$mail->Username = "eg@yahoo.com"; //account 
$mail->Password = "pass"; //password
$fromname = "name";
$email="someone@gmail.com";
$abcd="-------------";
$To = trim($email,"\r\n");
  $tContent   = '';

  $tContent .="<table width='550px' colspan='2' cellpadding='4'>
        <tr><td align='center'><img src='imgpath' width='100' height='100'></td></tr>
        <tr><td height='20'>&nbsp;</td></tr>
        <tr>
          <td>
            <table cellspacing='1' cellpadding='1' width='100%' height='100%'>
            <tr><td align='center'><h2>YOUR TEXT<h2></td></tr/>
            <tr><td>&nbsp;</td></tr>
            <tr><td align='center'>Name: ".trim($abcd,"\r\n")."</td></tr>
            <tr><td align='center'>ABCD TEXT: ".$abcd."</td></tr>
            <tr><td>&nbsp;</td></tr>                
            </table>
          </td>
        </tr>
        </table>";

  $mail->FromName = $fromname;        
  $mail->Subject = "Your Details."; 
  $mail->Body = $tContent;
  $mail->AddAddress($To); 
  //$mail->set('X-Priority', '1'); //Priority 1 = High, 3 = Normal, 5 = low
  $mail->Send();
    echo 'Message has been sent.......';
} catch (phpmailerException $e) {
echo $e->errorMessage();
}
?>
SMTP->错误:无法连接到服务器:(0)
SMTP错误:无法连接到SMTP主机。消息已发送。。。。。。。
端口号为465
SMTP->错误:不接受来自服务器的邮件:参数中存在501语法错误
以下发件人地址失败:root@localhost消息已发送。。。。。。。

对于yahoo,您可能需要yahoo plus帐户。有关yahoo smtp,请参见以下要求:

Yahoo! Mail Outgoing Mail (SMTP) Server: smtp.mail.yahoo.com
Use Authentication: Yes
Port: 25 or 587    
Yahoo! Mail Incoming Mail (POP3) Server: Only available in Yahoo! Mail Plus
Account Name: Your full email address or your Yahoo! ID
Email Address: Your email address
Password: Your Yahoo! ID password
注1:如果您的Internet服务提供商(ISP)阻止端口25,则必须使用备用SMTP端口号,如587

注2:AT&T客户使用smtp.att.yahoo.com和带有SSL的端口465

注3:如果您使用的是雅虎!小型企业电子邮件,更多详细信息,请访问


其他提供商您可以使用Outlook/Hotmail,AOL Outgoing Mail

对于yahoo,您可能需要yahoo plus帐户。请告诉我其他哪些邮件提供商(如gmail)可以免费发送促销邮件。我可以对Outlook/Hotmail,AOL Outgoing Mail(如gmail)执行相同的操作吗。或者我需要有任何像yahoo plus这样的特殊帐户。我没有尝试过,但它不需要AOL和outlook的任何特殊帐户。可能是……刚才我的hotmail帐户中有一封邮件,我们注意到你的outlook.com帐户中有一些不寻常的活动。为了帮助保护您,我们暂时阻止了您的帐户。你为什么看到这个?可能有人使用您的帐户发送了大量垃圾邮件或其他违反我们服务条款的内容。可能是,因为您正在使用带有代码的hotmail(远程)。有时候gmail也需要同样的权限。尝试查找hotmail是否还需要任何特殊权限。$mail=new PHPMailer()$邮件->IsHTML(正确)$邮件->SMTPDebug=1$邮件->IsSMTP()$邮件->SMTPAuth=true$邮件->SMTPSecure=“tls”$邮件->主机=“smtp.live.com”$邮件->端口=587;