shpasser / GaeSupportL5

Google App Engine Support package for Laravel 5
MIT License
160 stars 27 forks source link

Error when Mailgun as email provider instead of `gae` #48

Closed agentmilindu closed 8 years ago

agentmilindu commented 8 years ago

Hi @shpasser, when using Mailgun as email provider, I'm getting the following error. It seems the problem is with Guzzle's HTTPS.

production.ERROR: exception 'GuzzleHttp\Exception\ClientException' with message 'Client error: POST https://api.mailgun.net/v3/rsvp.lk/messages.mime resulted in a 401 Unauthorized response: Forbidden

I tried using cURL Lite also, that also gives errors. It is really good if we can use cURL Lite. Can we do something for this? I can't use GAE's email service as it has 100 mails per day limit.

shpasser commented 8 years ago

I'm getting the following error with cURL Lite:

production.ERROR: exception 'google\appengine\runtime\CurlLiteOptionNotSupportedException' with message 'Option 20056 is not supported by this curl implementation.' in /base/data/home/runtimes/php/sdk/google/appengine/runtime/CurlLite.php:487

I am not sure I would like to try and make it work, because it is probably not supported by GAE.

Did you look into SendGrid option? It is supported by GAE and has limitation of 12,000 emails per month for free.

agentmilindu commented 8 years ago

Hi @shpasser, SendGrid and MailGun both are suggested services by GAE. I think the problem is with cURL on HTTPS.

I could get my problem resolved using smtp driver with MailGun details.

I think this would be a common problem for everyone who send request using cURL. ( GAE has a limit on cURL requests, and have problem with HTTPS )

shpasser commented 8 years ago

Hi @agentmilindu, can we conclude this one? Any suggestions?

agentmilindu commented 8 years ago

Hi @shpasser, yes I think. If anyone got into this trouble, you can use smtp driver with MailGun details.

biblicalph commented 8 years ago

Actually I'm using mailgun with laravel 5.1 using the mailgun api and mails are working just fine.

401 unauthorized occurs if your mailgun credentials are not valid.

Hopefully this helps

agentmilindu commented 8 years ago

@biblicalph I doubt that, as I used the same credentials ( which was set on my .env file ) without any probelm before I moved to GCP, and I did not change the credentials in any way.

I thought it was a problem with cURL in GCP( with CA bundle, where the Mailgun tries to authorize the client connection with certificates ) when accessing MailGun API over HTTPS. I'm not sure about that too. May be a mistake in my end.

Thanks for pointing out it works with Laravel 5.1. I used Laravel 5.2 and tell me if it works on Laravel 5.2 too once you migrated :)