Godaddy帐户的带有laravel SMTP的电子邮件失败? [英] Email with laravel SMTP of Godaddy account fails?

查看:78
本文介绍了Godaddy帐户的带有laravel SMTP的电子邮件失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用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,
];

配置SwiftMailer本地域"在Symfony 2中轻松设置

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆