try this .. props.put("mail.smtp.host","smtp.correo.yahoo.es"); props.put("mail.smtp.port","25"); props.put("mail.smtp.auth", "true");
On Thu, Jul 17, 2008 at 12:41 PM, Carlos Morales Diego < [EMAIL PROTECTED]> wrote: > > > Hello Jonas, > > > I still have the same mistake, so I don't know, this is my code > > Properties props=new Properties(); > props.put("mail.smtp.host","smtp.correo.yahoo.es"); > props.put("mail.smtp.port","25"); > props.put("mail.smtp.auth", "true"); > Session s=Session.getInstance(props); > > > MimeMessage message=new MimeMessage(s); > > InternetAddress from=new InternetAddress("[EMAIL PROTECTED]"); > message.setFrom(from); > InternetAddress to=new InternetAddress("[EMAIL PROTECTED]"); > message.addRecipient(Message.RecipientType.TO,to); > > message.setSubject("Prueba de JavaMail"); > message.setText("Saludo de JavaMail"); > > Store store=s.getStore("pop3"); > store.connect("pop.correo.yahoo.es","[EMAIL PROTECTED] > ","bezos11"); > Transport.send(message); > > store.close(); > > And I don't know. Any advice? > > Thanks so much > > > Subject: RE: javax.servlet.ServletException: Could not connect to SMTP > host: localhost, port: 25 > > Date: Mon, 14 Jul 2008 14:14:40 +0200 > > From: [EMAIL PROTECTED] > > To: users@tomcat.apache.org > > > > 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","[EMAIL PROTECTED]","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: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > _________________________________________________________________ > Herramientas para combatir la crisis. MSN Dinero > http://dinero.es.msn.com/ > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Regards, Youssef