【问题标题】:Zend Mail - Email is not sentZend Mail - 电子邮件未发送
【发布时间】:2011-04-22 13:19:42
【问题描述】:

我在通过 zend_mail 发送注册电子邮件时遇到问题。邮件仅传输到具有@gmail.com 的邮件。

$email = "test@gmx.net";
$mail = new Zend_Mail ();
$mail->setBodyText ( 'some text' );
$mail->setBodyHtml ( 'some text' );
$mail->setFrom ( 'support@mysite.net', 'MySite.net' );
$mail->addTo ( $email, $email );
$mail->setSubject ( 'test' );
$mail->send ();

如果用户有其他电子邮件提供商,则不会发送电子邮件。

有什么想法吗?

【问题讨论】:

  • 你检查过垃圾邮件文件夹吗?
  • 是的,空的 :( hotmail.com 和 gmail.com 可以工作,但 gmx.de 和 web.de 不行。你可以看看,geldonkel.net/registration/register,这是我的一个小 zendf 项目,还没完呢^^
  • 为什么不使用 Zend 的 SMTP Class 而不是默认的(MAIL 函数)
  • 没用过,有例子吗,链接?

标签: php zend-framework zend-mail


【解决方案1】:

我现在使用 smtp,它可以工作:

 $config = array('auth' => 'login',
                    'username' => '****@gmail.com',
                    'password' => '****',
                    'port' => '25',
                    'ssl' => 'tls');


 $transport = new Zend_Mail_Transport_Smtp('smtp.googlemail.com', $config);

【讨论】:

    猜你喜欢
    • 2011-10-30
    • 2014-10-03
    • 1970-01-01
    • 2013-02-21
    • 2015-06-30
    • 2016-08-29
    • 1970-01-01
    • 1970-01-01
    • 2011-02-09
    相关资源
    最近更新 更多