0

我有自己的 smtp 主机,我可以在 Outlook 上接收电子邮件,但无法在 gmail 和 hotmail 服务器上接收。

   try {
            \Config::set('mail.username', env('MAIL_USERNAME_GLU'));
            \Config::set('mail.password', env('MAIL_PASSWORD_GLU'));
            \Config::set('mail.host', env('MAIL_HOST_GLU'));
            \Config::set('mail.port', env('MAIL_PORT_GLU'));
            \Config::set('mail.ssl', env('MAIL_PORT_GLU'));
            // \Config::set('mail.encryption', 'tls');
            Mail::to($data['email'])->cc(env('MAIL_CC_GLU'))->send(new GluRmaNotification($data));
            return ["message" => "Email sent successfully"];
        } catch (\Exception $e) {
            return ['message' => $e->getMessage()];
        }
4

0 回答 0