tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonas Wagner" <>
Subject RE: javax.servlet.ServletException: Could not connect to SMTP host: localhost, port: 25
Date Mon, 14 Jul 2008 12:14:40 GMT

It looks to me as if you didn't configure any SMTP server. You need to
do something like:
 Properties smtpProperties = new Properties();
 smtpProperties.put("", "");
 smtpProperties.put("mail.smtp.auth", "true");

 // create the mime message

 Session session = Session.getDefaultInstance(smtpProperties);
 Transport transport = session.getTransport("smtp");
 transport.connect(smtpHost, smtpUser, smtpPasswd);
 transport.sendMessage(mimeMessage, mimeMessage.getAllRecipients());

I don't know JavaMail that well, so I cannot tell you how it's supposed
to work with the static Transport::send() method, but you can probably
set the SMTP server in a property file.

> org.apache.jasper.JasperException: Exception in JSP: /sendmail.jsp:22
> 19: 	Store store=s.getStore("pop3");
> 20:
> 21:
> 22: 	Transport.send(message);
> 23:
> 24: 	store.close();
> 25: %>

I don't quite see what the store does in your code. Is this some sort of
pop-before-smtp authentification?


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message