drnmslpz42661 2015-10-20 23:46
浏览 48

无法通过Yahoo SMTP发送电子邮件

I am trying to use Yahoo SMTP server to send emails from a web site, located on local Windows server and based on Xampp.

As a result, this is what I have in my sendmail settings :

smtp_server=smtp.mail.yahoo.com
smtp_port=465
smtp_ssl=auto
auth_username=box1@yahoo.com
auth_password=pswd1

Then in PHP :

mail ('box1@yahoo.com', 'Static Mail 1', 'Static Message');
mail ('box2@yahoo.com', 'Static Mail 2', 'Static Message');

So, I am trying to send email from one Yahoo account to another but it does not work. I tried to send emails with GMail SMTP and it works fine but when I try to do this through Yahoo SMTP I always get an error :

From address not verified - see http://help.yahoo.com/l/us/yahoo/mail/original/manage/sendfrom-07.html 

As far as I know, this is a common problem when Yahoo does not allow to send emails on behalf of it, but in my case I am sending messages only between Yahoo accounts, what am I doing wrong?

Issue for cross server requests is described here but in some reason I am experiencing it even when I use only Yahoo accounts too.

  • 写回答

1条回答 默认 最新

  • dotif64826 2015-10-20 23:58
    关注

    Seems like the error is pretty self explanatory, add the fourth paramater for the mail function, something like this:

    <?php
    $to      = 'nobody@example.com';
    $subject = 'the subject';
    $message = 'hello';
    $headers = 'From: webmaster@example.com' . "
    " .
        'Reply-To: webmaster@example.com' . "
    " .
        'X-Mailer: PHP/' . phpversion();
    
    mail($to, $subject, $message, $headers);
    ?>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥50 我撰写的python爬虫爬不了 要爬的网址有反爬机制
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等