gpt4 book ai didi

php - Zend Mail - 不发送电子邮件

转载 作者:行者123 更新时间:2023-12-04 06:44:16 25 4
gpt4 key购买 nike

我在通过 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 ();

如果用户有另一个电子邮件提供商,则不会发送电子邮件。

有任何想法吗?

最佳答案

我现在使用 smtp 并且它有效:

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


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

关于php - Zend Mail - 不发送电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3885093/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com