tomcat-users mailing list archives

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

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("mail.smtp.host", "smtp.example.com");
 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);
 mimeMessage.saveChanges(); 
 transport.sendMessage(mimeMessage, mimeMessage.getAllRecipients());
 transport.close();

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:
store.connect("pop.correo.yahoo.es","chikichiki@yahoo.es","bezos11");
> 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?

Greetings,
Jonas

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message