Velocity Reviews

Velocity Reviews (
-   Software (
-   -   about sending e-mail in jsp using smtp host (

Mageshwari.E 02-21-2011 06:43 AM

about sending e-mail in jsp using smtp host
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8>
<title>JSP Page</title>

String host = "";
int port = 587;
String username = "";
String password = "anideepskarthi";

Properties props = new Properties();
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");

Session session1 = Session.getInstance(props);

try {

Message message = new MimeMessage(session1);
message.setFrom(new InternetAddress(""));
InternetAddress.parse("")) ;
message.setSubject("Testing Subject");
message.setText("Dear Mail Crawler,\n\n No spam to my email, please!");

Transport transport = session1.getTransport("smtp");
transport.connect(host, port, username, password);



} catch (MessagingException e) {
throw new RuntimeException(e);


i just receive these type of exception;

type Exception report


descriptionThe server encountered an internal error () that prevented it from fulfilling this request.


org.apache.jasper.JasperException: java.lang.RuntimeException: javax.mail.MessagingException: Unknown SMTP host:;
nested exception is:

can any one solve this and please give the response soon........

All times are GMT. The time now is 09:46 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.