zoukankan      html  css  js  c++  java
  • Laravel发送邮件

    .env文件配置
    MAIL_MAILER=smtp
    MAIL_HOST=smtp.163.com
    MAIL_PORT=465
    MAIL_USERNAME=ayiui4566@163.com
    MAIL_PASSWORD=邮箱密码
    MAIL_ENCRYPTION=ssl
    MAIL_FROM_ADDRESS=ayiui4566@163.com
    MAIL_FROM_NAME="${APP_NAME}"

    代码部分
    public function mail(){
            $m3_email = new stdClass();
            $m3_email->to = "254646295@qq.com";
            $m3_email->cc = 'magina@speakez.cn';
            $m3_email->subject = '凯恩书店验证';
            $m3_email->content = '请于24小时点击该链接完成验证. http://book.magina.com/service/validate_email'
                . '?member_id=' . 10001
                . '&code=' . Str::uuid();
            $flag  = Mail::send('email_register', ['m3_email' => $m3_email], function ($m) use ($m3_email) {
                // $m->from('hello@app.com', 'Your Application');
                $m->to($m3_email->to, '尊敬的用户')
                    ->cc($m3_email->cc)
                    ->subject($m3_email->subject);
            });
            return $flag ?'发送成功':'发送失败';
        }
  • 相关阅读:
    阿牛的EOF牛肉串
    盐水的故事
    密码
    Digital Roots
    不容易系列之(3)—— LELE的RPG难题
    不容易系列之一
    超级楼梯
    母牛的故事
    蟠桃记
    Children’s Queue
  • 原文地址:https://www.cnblogs.com/as3lib/p/14459986.html
Copyright © 2011-2022 走看看