SOLVED - [email protected] - Error on send e-mail with AWS SES

6.6k Views Asked by At

I'm starting a service that sends automatic e-mails using Laravel Cron, AWS WorkMail and AWS SES. I have about 10 users, and it is OK for (almost) everyone.

One user says that he can't receive any e-mail.

Here is the error message given by AWS SES:

https://i.stack.imgur.com/ahrAj.jpg

And here is my Route53 configs:

https://i.stack.imgur.com/KKHWv.png

Other users receive is normaly.

I'm working on it for weeks and can't solve it :(

Laravel code:

<?php
use Illuminate\Support\Facades\Mail;

// Some code

Mail::send([], [], function($m) {
    $m->from(env("MAIL_FROM"), $this->email_reply["name"]);
    $m->to($this->email_to["email"], $this->email_to["name"])->subject($this->title);
    $m->setBody($this->parseFastText(!!"email"), "text/html");
});

SES configuration is correct on project, just one user have problem to receive e-mails.

It is an e-mail with a custom domain (foobar.com.br), idk if it is a problem between AWS SES and custom domains.

I thought it could be a filter in client e-mail server, but not sure.

I have also tried with a Zoho Mail before AWS Workmail and the same error occourred.

Mail Tester: https://www.mail-tester.com/test-ralvhoi3f


SOLVED:

<?php
use Illuminate\Support\Facades\Mail;

// Some code

Mail::send([], [], function($m) {
    $body = $this->parseFastText(!!"email");
    $m->from(env("MAIL_FROM"), $this->email_reply["name"]);
    $m->to($this->email_to["email"], $this->email_to["name"])->subject($this->title);
    // --- ADD
    $m->addPart(filter_var($body, FILTER_SANITIZE_STRING), "text/plain");
    // ---
    $m->setBody($body, "text/html");

});
0

There are 0 best solutions below