2017-07-18 34 views
0

在config/mail.php中設置正確的配置後,我似乎無法發送帶有laravel 5.4的郵件。我在這裏使用smtp驅動程序是我的文件的摘要。
這裏是配置/ mail.php類Swift_Transport_Esmtp_Auth_CramMd5Authenticator不存在

<?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', '[email protected]'), 
    '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

我需要儘快幫助,謝謝。 – wadleo

回答

1

來解決這個問題的最好辦法是刪除文件在供應商文件夾,並重新安裝作曲家和作曲家更新,這就是我如何固定我的問題