spatie / mailcoach-support

Questions and support for Mailcoach
https://mailcoach.app
31 stars 2 forks source link

Problem to send using Sendgrid #163

Closed electronick86 closed 4 years ago

electronick86 commented 4 years ago

Hello,

I would like to use sendgrid with mailcoach.

Is it correct to use the package "s-ichikawa/laravel-sendgrid-driver": "^3.0" in order to send via the sendgrid API (and not using the smtp)?

I can send a test message without any problem but when I send the campaign, I receive the following message :

[2020-04-20 16:41:20] local.ERROR: Client error: POST https://api.sendgrid.com/v3/mail/send resulted in a 400 Bad Request response: {"errors":[{"message":"The content value must be a string at least one character in length.","field":"content.0.value"," (truncated...) {"userId":1,"exception":"[object] (GuzzleHttp\Exception\ClientException(code: 400): Client error: POST https://api.sendgrid.com/v3/mail/send resulted in a 400 Bad Request response: {\"errors\":[{\"message\":\"The content value must be a string at least one character in length.\",\"field\":\"content.0.value\",\" (truncated...) at /var/www/html/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113) [stacktrace]

0 /var/www/html/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create()

1 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}()

2 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler()

3 /var/www/html/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()

4 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(246): GuzzleHttp\Promise\TaskQueue->run()

5 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(223): GuzzleHttp\Promise\Promise->invokeWaitFn()

6 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(267): GuzzleHttp\Promise\Promise->waitIfPending()

7 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList()

8 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()

9 /var/www/html/vendor/guzzlehttp/guzzle/src/Client.php(183): GuzzleHttp\Promise\Promise->wait()

10 /var/www/html/vendor/s-ichikawa/laravel-sendgrid-driver/src/Transport/SendgridTransport.php(306): GuzzleHttp\Client->request()

11 /var/www/html/vendor/s-ichikawa/laravel-sendgrid-driver/src/Transport/SendgridTransport.php(78): Sichikawa\LaravelSendgridDriver\Transport\SendgridTransport->post()

I suppose I didn't configure something right but I don't know what.

Thanks in advance.

freekmurze commented 4 years ago

Mailcoach only supports SMTP when sending mail via Sendgrid. So if possible, use SMTP.

electronick86 commented 4 years ago

Hello Freek.

I'm maybe wrongly thinking that smtp is not suited for high volumes. Do you think I can send at 50-80 emails/sec using smtp? Otherwise, do you think it would be a hard work for me to develop that part?

Thanks!