wood burning stoves 2.0*
The moose likes JSP and the fly likes Sending automated mails  -- Error -Not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Sending automated mails  -- Error -Not working" Watch "Sending automated mails  -- Error -Not working" New topic
Author

Sending automated mails -- Error -Not working

bharath
Greenhorn

Joined: Dec 11, 2006
Posts: 2
I am using java mail bean to send a email & I am receving this
error message

javax.mail.SendFailedException: Sending failed; nested exception is: javax.mail.SendFailedException: Invalid Addresses; nested exception is: javax.mail.SendFailedException: 553 sorry, Authentication failed or timed out. Please do get messages first to authenticate yourself.(#4.4.3)

I have used a mail bean the code of which is given below



import java.*;
import sun.net.smtp.SmtpClient;
import java.io.*;
import java.util.Date;

public class mailbean {

public void send (String to, String from, String sub, String mes) {
try{
Date dt = new Date();
SmtpClient client = new SmtpClient(" ");
client.from(from);
client.to(to);
PrintStream message = client.startMessage();
message.println("From: " + from);
message.println("To: " + to);
message.println("Sent: " + dt);
message.println("Subject:"+sub);
message.println();
message.println(mes);
message.println();
client.closeServer();
}
catch (IOException e){
System.out.println(e);
}
}

}

This code was working fine before. We have changes our mail server to rediff. When I am replacing the old smtp addrress with the new one I am getting the above error.
I would request someone of you to provide a solution for this .
Thanks a lot in advance for the solution


Now our mail server is
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

bharath N M
Welcome to JavaRanch!

We're pleased to have you here with us in the JSP forum, but there
are a few rules that need to be followed, and one is that proper names are
required. Please take a look at the
JavaRanch Naming Policy and
adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious. You may use initials for the first name but not the last.

You can change it here


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sending automated mails -- Error -Not working
 
Similar Threads
Sending HTML format mail thru JSP
NoSuchProviderException: smtp
Sending automated mails -- Error -Not working
how to send a mail from a jsp?
I'm trying to make my code send me email - pliz help.