0
votes

I am currently using Mailgun for sending emails. I have verified my domain and entered all the records correctly.

I am using laravel which provides an easy way to use mailgun for sending emails.

I have given a MAIL_FROM_ADDRESS as a gmail address eg.

[email protected]
[email protected]

But this is not working at all. The Mailgun logs shows email is delivered but no email is received in my gmail inbox at eg. [email protected]

So is it because my MAIL_FROM_ADDRESS is a gmail address and not a domain email address?

1
Is the Mailgun account in Sandbox mode by chance?Adam
No. I have added and verified my new domainRaj
If the from email address is a google one it may be google blocking it as they will not recognise the sender. Try sending an email to a non-gmail address and see if that works.James Cook

1 Answers

1
votes

The way that I've always used mail gun is that when you are in your mailgun account and click on the domain. I use the Defualt SMTP Login (under Domain Information) and that is my MAIL_FROM_ADDRESS Here is a snippet from my code that may or may not help you. In this example I'm using a blade template for the email.

try {
    Mail::send('hostconfirmationemail', ['client' => $event->client,  
                                           'user' => $event->user], 
        function ($mail) use ($event) {
            $mail->from('[email protected]', 'Mail Room');
            $mail->to($event->user->email)->subject('New Lead Seminar RSVP Confirmation');
    });
} catch (\Exception $e) {
   return $e->getMessage();
}