1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
@GET
@Path("/{smtp}:{port}/{userServMail}/{passwordServMail}")
public Response getMsg(@PathParam("smtp") String smtp, @PathParam("userServMail") String idServMail,
@PathParam("password") String passwordServMail, @PathParam("port") String portServMail,
@PathParam("mailMessage") MailMessage mailMessage) {
MailSender mailSender = new MailSender(smtp, idServMail, passwordServMail);
try {
mailSender.sendMessage(mailMessage, smtp, idServMail, passwordServMail, portServMail);
} catch (MessagingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// String output = "Jersey repond ia OBJIS : " + msg;
String output = "host " + smtp + " port " + portServMail;
return Response.status(200).entity(output).build();
} |
Partager