test mail ok
This commit is contained in:
parent
a9cafc90da
commit
9464408bf9
@ -1,12 +1,17 @@
|
|||||||
package com.covas.Resources;
|
package com.covas.Resources;
|
||||||
|
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.CompletionStage;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
|
import javax.ws.rs.core.Response;
|
||||||
|
|
||||||
import io.quarkus.mailer.Mail;
|
import io.quarkus.mailer.Mail;
|
||||||
|
import io.quarkus.mailer.Mailer;
|
||||||
import io.quarkus.mailer.reactive.ReactiveMailer;
|
import io.quarkus.mailer.reactive.ReactiveMailer;
|
||||||
import io.smallrye.mutiny.Uni;
|
|
||||||
|
|
||||||
@Path("mail")
|
@Path("mail")
|
||||||
public class MailRessource {
|
public class MailRessource {
|
||||||
@ -14,9 +19,12 @@ public class MailRessource {
|
|||||||
@Inject
|
@Inject
|
||||||
private ReactiveMailer mail;
|
private ReactiveMailer mail;
|
||||||
|
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
public Uni<Void> sendMail(){
|
public CompletionStage<Response> sendMail(){
|
||||||
return mail.send(Mail.withText("valcze80@gmail.com", "toto", "toto"));
|
return mail.send(Mail.withText("valcze80@gmail.com", "async", "toto"))
|
||||||
|
.subscribeAsCompletionStage()
|
||||||
|
.thenApply(x -> Response.accepted().build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,7 +16,8 @@ covas.schema.create = true
|
|||||||
quarkus.mailer.auth-methods=DIGEST-MD5 CRAM-SHA256 CRAM-SHA1 CRAM-MD5 PLAIN LOGIN
|
quarkus.mailer.auth-methods=DIGEST-MD5 CRAM-SHA256 CRAM-SHA1 CRAM-MD5 PLAIN LOGIN
|
||||||
quarkus.mailer.from=valczebackup@gmail.com
|
quarkus.mailer.from=valczebackup@gmail.com
|
||||||
quarkus.mailer.host=smtp.gmail.com
|
quarkus.mailer.host=smtp.gmail.com
|
||||||
quarkus.mailer.port=465
|
quarkus.mailer.port=587
|
||||||
quarkus.mailer.ssl=true
|
quarkus.mailer.start-tls=REQUIRED
|
||||||
quarkus.mailer.username=valczebackup@gmail.com
|
quarkus.mailer.username=valczebackup@gmail.com
|
||||||
quarkus.mailer.password=aohrpmqvxldwyebs
|
quarkus.mailer.password=aohrpmqvxldwyebs
|
||||||
|
quarkus.mailer.mock=false
|
Loading…
x
Reference in New Issue
Block a user