Godaddy帐户的带有laravel SMTP的电子邮件失败? [英] Email with laravel SMTP of Godaddy account fails?
问题描述
我正在尝试使用LarsGodaddy帐户发送电子邮件,但我总是收到错误消息
AbstractSmtpTransport.php第383行中的Swift_TransportException: 预期的响应代码为250,但代码为"501",并显示消息"501 HELO需要有效地址"
以下我用于在控制器中发送电子邮件的代码:
$title = 'Test email';
$content = 'Test email from shingora';
Mail::send('emails.send', ['title' => $title, 'content' => $content], function ($message) {
$message->from('robin.shingora@gmail.com', 'Shingora');
$message->subject('Test email');
$message->to('robin.shingora@gmail.com');
});
在mail.php中
return [
'driver' => 'smtp',
'host' => 'smtpout.asia.secureserver.net',
'port' => 25,
'from' => ['address' => 'example@gmail.com', 'name' => 'test'],
'encryption' => 'ssl',
'username' => 'example@gmail.com',
'password' => '********',
'sendmail' => 'D:\sendmail\sendmail -bs',
'pretend' => false,
];
I am trying to send an email in laravel with godaddy account but I always get an error
Swift_TransportException in AbstractSmtpTransport.php line 383: Expected response code 250 but got code "501", with message "501 HELO requires valid address"
Below code I used for the sending the email in controller:
$title = 'Test email';
$content = 'Test email from shingora';
Mail::send('emails.send', ['title' => $title, 'content' => $content], function ($message) {
$message->from('robin.shingora@gmail.com', 'Shingora');
$message->subject('Test email');
$message->to('robin.shingora@gmail.com');
});
And in mail.php
return [
'driver' => 'smtp',
'host' => 'smtpout.asia.secureserver.net',
'port' => 25,
'from' => ['address' => 'example@gmail.com', 'name' => 'test'],
'encryption' => 'ssl',
'username' => 'example@gmail.com',
'password' => '********',
'sendmail' => 'D:\sendmail\sendmail -bs',
'pretend' => false,
];
Few weeks ago I had same issue and I solved the problem by realising that GoDaddy likes to have your from and reply-to e-mail should belong to your own domain.
And it may be a problem with your hostname, so I've browsed to another SO question and found this:
Configure SwiftMailer "Local Domain" setting easily, in Symfony 2
这篇关于Godaddy帐户的带有laravel SMTP的电子邮件失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!