在config / mail.php中设置正确的配置后,我似乎无法发送带有laravel 5.4的电子邮件。我在这里使用smtp驱动程序是我文件的摘要 这是 config / mail.php
<?php
return [
'driver'=>env('MAIL_DRIVER', 'smtp'),
'host'=>env('MAIL_HOST', 'smtp.gmail.com'),
'port' => env('MAIL_PORT', 587),
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'info@afecamworld.org'),
'name' => env('MAIL_FROM_NAME', 'National President'),
],
'encryption' => env('MAIL_ENCRYPTION', 'ssl'),
'username' => env('MAIL_USERNAME', 'my-gmail-email'),
'password' => env('MAIL_PASSWORD', 'my-gmail-password'),
'sendmail' => '/usr/sbin/sendmail -bs',
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
这是 SendActivationEmail 类
<?php
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class SendActivationEmail extends Notification {
use Queueable;
protected $token;
public function __construct($token) {
$this->token = $token;
}
public function via($notifiable){
return ['mail', 'database'];
}
public function toMail($notifiable) {
return (new MailMessage)->subject('Activation Your Account')->greeting('Hello!')->line('You need to activate your email before you can login.')->action('Activate Email', route('activate_account', ['token' => $this->token]))->line('Thank you for joining our Online Community!');
}
}
?>
这是错误的最重要部分
(1/1) ReflectionException
类Swift_Transport_Esmtp_Auth_CramMd5Authenticator不存在 在DependencyContainer.php中(第309行)
感谢您在dreamhost上解决此错误的任何帮助,谢谢。
答案 0 :(得分:1)
解决此问题的最佳方法是删除供应商文件夹中的文件以及重做作曲家安装和编辑器更新,这就是我解决问题的方法