Tuesday, February 28, 2017

Getting error while trying to send an email with Laravel

I want to send an email with Laravel. I am not sure what am I doing wrong.

Here is my Mail:

public function __construct()
{
    //
}

/**
 * Build the message.
 *
 * @return $this
 */
public function build()
{
    return $this->from('test@test.de')
                  ->view('emails.testemail');
}

Here is my controller:

public function send_email_test(){
Mail::to("my_email@mail.net")->send(new testemail());
}

Here is how I try to test it:

Route::get('/sendemailtext','testcontroller@send_test_email');

Here is the error:

Swift_TransportException in AbstractSmtpTransport.php line 383:
Expected response code 220 but got code "", with message ""

Any ideas?




via prgrm

Advertisement