dongmei8460 2018-07-16 06:15
浏览 125
已采纳

Laravel使用MDaemon电子邮件服务器发送电子邮件但收到错误“需要验证”

I'm trying to send email with my laravel local app using MDaemon WorldClient Private Email email server but i always get this error

Expected response code 250 but got code "530", with message "530 5.7.0 Authentication required"

With my laravel local app, I already tried to send email using mailtrap and gmail and both works fine.

This is my email configuration in .env file

MAIL_DRIVER=smtp
MAIL_HOST=mail.emaildomain.co.id
MAIL_PORT=587
MAIL_USERNAME=myname@emaildomain.co.id
MAIL_PASSWORD=******
MAIL_ENCRYPTION=null

To see if there's something wrong with my email configutraion, I also tried to send email using outlook on my computer with the same email account and configuration that I use on laravel and it works perfectly on outlook. I already double check the outlook SMTP configuration and the laravel but I have no idea why it always fails on laravel.

By the way, i'm using mailable on laravel.

Thank you

  • 写回答

1条回答 默认 最新

  • dou1908 2018-07-20 10:48
    关注

    Sorry I did a silly mistake.

    It's just the from parameter of the email and the email username doesn't match.

    Just for a tip, make sure you set all the email config on the .env file. It'll help you a lot. I did the mistake because I set the from parameter in Mailable class and the other in .env.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?