Tried Sample program to send mail using Java Mail Apis and it is working fine
but Camel SMTP is not working: Code is given below to send mail uysing
Sample Program:

public class SendMailSSL {
 public static void main(String[] args) {
  Properties props = new Properties();
  props.put("mail.smtp.host", "smtp.gmail.com");
  props.put("mail.smtp.socketFactory.port", "465");
  props.put("mail.smtp.socketFactory.class",
    "javax.net.ssl.SSLSocketFactory");
  props.put("mail.smtp.auth", "true");
  props.put("mail.smtp.port", "465");
 
  Session session = Session.getDefaultInstance(props,
   new javax.mail.Authenticator() {
    protected PasswordAuthentication getPasswordAuthentication() {
     return new PasswordAuthentication("username","password");
    }
   });
 
  try {
 
   Message message = new MimeMessage(session);
   message.setFrom(new InternetAddress("[email protected]"));
   message.setRecipients(Message.RecipientType.TO,
     InternetAddress.parse("[email protected]"));
   message.setSubject("Testing Subject");
   message.setText("Dear," +
     "\n\n No spam please!");
 
   Transport.send(message);
 
   System.out.println("Done");
 
  } catch (MessagingException e) {
   throw new RuntimeException(e);
  }
 }
}







--
View this message in context: 
http://camel.465427.n5.nabble.com/CAMEL-SMTP-Mail-Componenet-Issue-on-64-Bit-Windows-2008-Server-tp4681784p4684978.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to