太空飞船 2016-03-15 11:59:40 13150次浏览 1条评论 0 0 0

Expected response code 250 but got code "501", with message "501 mail from address must be same as authorization user "

501 发件人邮箱必须与认证帐号相同

  • 评论于 2016-03-17 15:30 举报

    yes! must be the same.
    You can config like this, then you don't need to set mail from when send mails.

    'mailer' => [
                'class' => 'yii\swiftmailer\Mailer',
                'useFileTransport' => false,//set this property to false to send mails to real email addresses
                //comment the following array to send mail using php's mail function
                'transport' => [
                    'class' => 'Swift_SmtpTransport',
                    'host' => 'smtp.yeah.net',
                    'username' => 'flyfame@yeah.net',
                    'password' => 'ddd',
                    'port' => '587',
                    'encryption' => 'ssl',
                ],
                'messageConfig' => [
                    'charset' => 'UTF-8',
                    'from' => ['flyfame@yeah.net'=>'系统邮件'],
                ],
            ],
    
    觉得很赞
您需要登录后才可以评论。登录 | 立即注册