Jean-Phi Baconnais
Jean-Phi Baconnais

Reputation: 100

Quarkus - no error but no email (with gmail)

i'm trying to send email with quarkus with this guide https://quarkus.io/guides/mailer#gmail-specific-configuration.

I use this code :

@Inject
Mailer mailer;

@GET
public Response sendMailTest() {
   mailer.send(Mail.withHtml("<mail gmail>", "A simple email from quarkus", "<p>This is my body.<p>"));
   return Response.accepted().build();
}

with this parameters :

quarkus.mailer.auth-methods=DIGEST-MD5 CRAM-SHA256 CRAM-SHA1 CRAM-MD5 PLAIN LOGIN
quarkus.mailer.from=<mail gmail>
quarkus.mailer.host=smtp.gmail.com
quarkus.mailer.port=465
quarkus.mailer.ssl=true
quarkus.mailer.username=<mail gmail>
quarkus.mailer.password=<app gmail password>

I haven't some error but i haven't some mail. The app password gmail has configured for this usecase ...

Anybody has any idea ?

Thanks !

Upvotes: 5

Views: 3032

Answers (2)

Giba
Giba

Reputation: 31

in .properties, use the parameter

quarkus.mailer.mock=false

Upvotes: 3

Serkan
Serkan

Reputation: 1235

Did you read this ?

quarkus.mailer.mock

Enables the mock mode, not sending emails. The content of the emails is printed on the console. Disabled by default on PROD, enabled by default on DEV and TEST modes.

Have you tested this by running your app as a standalone jar ?

Upvotes: 4

Related Questions