尝试使用laravel向动态接收者发送电子邮件

时间:2019-09-03 13:44:41

标签: laravel

我正在将电子邮件发送为静态电子邮件,并且可以正常工作,但是当我尝试向动态用户发送从数据库获取数据时,它返回此错误:Expected response code 250 but got code "530",并显示消息"530 5.7.1 Authentication required"

我的发送电子邮件功能:

public function send_email()
{   
    $getStaff=DB::table('users')
        ->OrderBy('id','DESC')
        ->first();

    $staffacckey=$getStaff->access_key;
    $staffemail=$getStaff->email;

    $valueurl = env('APP_URL');

    $info = array();
    $info['url']=$valueurl;
    $info['name']='tinox';
    $info['msg']='test';
    $info['key']=$staffacckey;

    Mail::send('email.mail',$info, function($email) {
        $ghost='no-reply@domain.com';
        $admin='System Administrator';
        $email->from($ghost, $admin);
        $email->to($staffemail)->subject('email confirmation');
    });       
}

1 个答案:

答案 0 :(得分:0)

preprocessors: {
      'webapp/controller/*.js': ['babel', 'coverage']
      // './!(test|localService)/**/*.js': ['coverage']
    },

    babelPreprocessor: {
      options: {
        presets: ['@babel/preset-env'],
        sourceMap: 'inline'
      },

      sourceFileName: function(file) {
        return file.originalPath;
      }
    }