<%@page import ="java.sql.*" %> <%@ page import="java.io.*,java.util.*,javax.mail.*"%> <%@ page import="javax.mail.internet.*,javax.activation.*"%> <%@ page import="javax.servlet.http.*,javax.servlet.*" %> <% String host ="smtp.live.com"; String from ="my hotmail email id@hotmail.com"; String to ="receiver mail id.com"; String pass="my hotmail password "; // Get system properties Properties props = System.getProperties(); // Setup mail server props.put("mail.smtp.host", host); props.put("mail.smtp.user","myid@hotmail.com"); props.put("mail.smtp.password","mypassword"); Session msession = Session.getDefaultInstance(props, null); // Define message MimeMessage message = new MimeMessage(msession); message.setFrom(new InternetAddress(from)); message.addRecipient(Message.RecipientType.TO, new InternetAddress(to)); message.setSubject("Hello JavaMail"); message.setText("Welcome to JavaMail"); Transport tr = msession.getTransport("smtp"); tr.connect(host, from, pass); // Send messa tr.send(message); // Send message %>
type Exception report message descriptionThe server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: javax.mail.MessagingException: Could not convert socket to TLS; nested exception is: java.io.IOException: Server is not trusted: smtp.live.com root cause javax.mail.MessagingException: Could not convert socket to TLS; nested exception is: java.io.IOException: Server is not trusted: smtp.live.com root cause java.io.IOException: Server is not trusted: smtp.live.com note The full stack traces of the exception and its root causes are available in the GlassFish v3 logs.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)