I could not solve the problem, so I consulted the web is in the configuration of tomcat. If anyone can help me I appreciate it. I tried sending email from a normal java method and I get the following error:
javax.mail.NoSuchProviderException: smtp
Source Code Java:
public void send(){
MimeMultipart multipart = new MimeMultipart();
Properties properties = new Properties();
properties.put("mail.smtp.host", "10.1.1.20");
Session session = Session.getDefaultInstance(properties, null);
session.setDebug(true);
try {
MimeMessage msg = new MimeMessage(session);
msg.setFrom(new InternetAddress("carlosj@audifarma.com.co"));
msg.setRecipients(Message.RecipientType.TO, "cmjhingeniero@yahoo.es");
msg.setSubject("PROBANDO");
msg.setSentDate(new Date());
MimeBodyPart mbp = new MimeBodyPart();
mbp.setText("PROBANDO");
multipart.addBodyPart(mbp);
msg.setContent(multipart);
Transport t = session.getTransport("smtp");
t.connect();
Transport.send(msg);
t.close();
System.out.println("===>Correo Enviado...");
}
catch (Exception mex){
System.out.println("===>Error MailSender.send() = "+mex);
}
}
Thanks