I'm using Laravel 5.0 for my project and i have to send mail to admin whenever user submits a contact us form. The mail functionality was working fine in my local but when i moved to production server (CENTOS) it was not working. PHP mail() is working but laravel mail(), not able to get what is happening.
$sent = Mail::raw('plain text message', function ($message) {
$message->from('gbhyri@gmail.com', 'bhyri');
$message->to('gayatri.bhyri@gmail.com', 'gayatri');
$message->subject('Subject');
});
dd($sent);
I'm getting 0 as ouput,
When i run dd(Mail::failures)
getting as
array:1 [▼
0 => "gayatri.bhyri@gmail.com"
]
Don't know what is happening... Any suggestions were I'm missing...
did you take a look at the postfix log ?
you might wanna install postfix if it's not https://www.digitalocean.com/community/tutorials/how-to-install-postfix-on-centos-6
May be the issue with you setting up you 'MAIL_DRIVER'. Please re check it. MAIL_DRIVER should be "mailgun" and try with MAIL_PRETEND to false. You can see in detail here
Let me know if you still facing the same.
Hi, Thanks for your reply. i'm not suppose to use any API's, so using laravel mail::send() for emails as a driver mail.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community