Check how to accept certificates from SMTP server.
dilawar
--
--
The website for the club is http://wncc-iitb.org/
To post to this group, send email to wncc...@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "Web and Coding Club IIT Bombay" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wncc_iitb+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
I am able to use gmail smtp server to send emai [using java mail] from external network. However, within iit network, I am trying to use smpt-auth.iitb.ac.in and it fails to send mails.
The following is the code.
final String username = "ldapid";final String password = "ldappasswd";Properties props = new Properties();props.put("mail.smtp.host", "smtp-auth.iitb.ac.in");props.put("mail.smtp.port", "25");props.put("mail.smtp.ehlo", "true");props.put("mail.smtp.starttls.enable", "true");props.put("mail.smtp.ehlo", "true");props.put("mail.smtp.auth", "true");props.put("mail.debug", "true");Session session = Session.getInstance(props,new javax.mail.Authenticator() {protected PasswordAuthentication getPasswordAuthentication() {return new PasswordAuthentication(username, password);}});try {Message message = new MimeMessage(session);
message.setFrom(new InternetAddress("ldapid@iitb.ac.in"));message.setRecipients(Message.RecipientType.TO,InternetAddress.parse("recepien...@gmail.com"));
message.setSubject("Testing Mail");message.setText("test email !");Transport.send(message);} catch (MessagingException e) {throw new RuntimeException(e);}}