aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes java mail error SendFailedException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "java mail error SendFailedException" Watch "java mail error SendFailedException" New topic
Author

java mail error SendFailedException

Pankaj Jha
Greenhorn

Joined: May 20, 2000
Posts: 21
hi gurus,
i am trying to test sun provided demo programs for testing JAVA Mail API
i am getting these errors please help me out ......

thanks in advance

DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth false
DEBUG: SMTPTransport trying to connect to host "my.test-inc.com", port 25
DEBUG SMTP RCVD: 220 X1 NT-ESMTP Server my.test-inc.com (IMail 6.05 30687-1)
DEBUG: SMTPTransport connected to host "my.test-inc.com", port: 25
DEBUG SMTP SENT: EHLO pankaj01
DEBUG SMTP RCVD: 250-my.test-inc.com says hello

DEBUG SMTP: use8bit false
DEBUG SMTP SENT: MAIL FROM:<pankaj@test-inc.com>
DEBUG SMTP RCVD: 250-SIZE 0

DEBUG SMTP SENT: RCPT TO:<pankaj@test-inc.com>
DEBUG SMTP RCVD: 250-8BITMIME

Verified Addresses
pankaj@dcr-inc.com
DEBUG SMTP SENT: DATA
DEBUG SMTP RCVD: 250-DSN

DEBUG SMTP SENT: QUIT
javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: 250-DSN

java.lang.Throwable(java.lang.String)
java.lang.Exception(java.lang.String)
javax.mail.MessagingException(java.lang.String, java.lang.Exception)
javax.mail.SendFailedException(java.lang.String, java.lang.Exception, javax.mail.Address [], javax.mail.Address [], javax.mail.Address [])
void javax.mail.Transport.send0(javax.mail.Message, javax.mail.Address [])
void javax.mail.Transport.send(javax.mail.Message)
void adt.com.ocs.ldap.ui.SendFile.main(java.lang.String [])


Re: no one has answer of my question?? please help!!
Author: dritesh Jul 22, 2001 1:41 PM


I need to know your script ie java files.

Re: no one has answer of my question?? please help!!
Author: pnk_jha Jul 23, 2001 6:02 AM


i will appriciate if any one tell me that, what am i doing wrong here....
here is the code......
===================
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;
public class MailExample
{
public static void main (String args[]) throws Exception
{
String smtpHost = "my.test-inc.com";
//String smtpHost = "smtp.mail.yahoo.com";
String popHost = "my.test-inc.com";
//String popHost = "pop.mail.yahoo.com";
String from = "pankaj@my.test-inc.com";
String to = "pankaj@my.test-inc.com";
String username = "pankaj";
String password = "pjha";
// Get system properties
Properties props = System.getProperties();
// Setup mail server
props.put("mail.smtp.host", smtpHost);
props.put("mail.smtp.auth", "true");
// Get session
Session session = Session.getInstance(props, new MyAthenticator());
session.setDebug(true);
// Pop Authenticate yourself
Store store = session.getStore("pop3");
store.connect(popHost, username, password);
// Define message
MimeMessage message = new MimeMessage(session);
InternetAddress addrTO=new InternetAddress(to);
InternetAddress addrFROM=new InternetAddress(from);
message.setFrom(addrTO);
System.out.println("from: "+addrFROM.getAddress());
System.out.println("to: "+addrTO.getAddress());
message.addRecipient(Message.RecipientType.TO,addrFROM);
message.setSubject("Hello JavaMail");
message.setText("Welcome to Yahoo's JavaMail");
Transport transport = session.getTransport("smtp");
transport.connect(smtpHost, username, password);
// Send message
transport.send(message);
}
}
class MyAthenticator extends Authenticator
{
public PasswordAuthentication getPasswordAuthentication()
{
return new PasswordAuthentication("pankaj","pjha");
}
}

================
here is the error which is coming.......

DEBUG: getProvider() returning javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsy stems, Inc]
POP3: connecting to host "my.test-inc.com", port 110
S: +OK X1 NT-POP3 Server my.test-inc.com (IMail 6.05 53501-1)
C: USER pankaj
S: +OK welcome
C: PASS pjha
S: +OK maildrop locked and ready
from: pankaj@my.test-inc.com
to: pankaj@my.test-inc.com

DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true

DEBUG: SMTPTransport trying to connect to host "my.test-inc.com", port 25

DEBUG SMTP RCVD: 220 X1 NT-ESMTP Server my.test-inc.com (IMail 6.05 40049-1)

DEBUG: SMTPTransport connected to host "my.test-inc.com", port: 25

DEBUG SMTP SENT: EHLO pankaj01
DEBUG SMTP RCVD: 250-my.test-inc.com says hello

DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: useEhlo true, useAuth true

DEBUG: SMTPTransport trying to connect to host "my.test-inc.com", port 25

DEBUG SMTP RCVD: 220 X1 NT-ESMTP Server my.test-inc.com (IMail 6.05 40050-2)

DEBUG: SMTPTransport connected to host "my.test-inc.com", port: 25

DEBUG SMTP SENT: EHLO pankaj01
DEBUG SMTP RCVD: 250-my.test-inc.com says hello
DEBUG SMTP: use8bit false
DEBUG SMTP SENT: MAIL FROM:<pankaj@my.test-inc.com>
DEBUG SMTP RCVD: 250-SIZE 0
DEBUG SMTP SENT: RCPT TO:<pankaj@my.test-inc.com>
DEBUG SMTP RCVD: 250-8BITMIME
Verified Addresses
pankaj@my.test-inc.com
DEBUG SMTP SENT: DATA
DEBUG SMTP RCVD: 250-DSN
DEBUG SMTP SENT: QUIT
javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: 250-DSN
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at MailExample.main(MailExample.java:45)
Exception in thread "main" Process Exit...


------------------
Aaron Briel
Greenhorn

Joined: Aug 02, 2001
Posts: 6
Hello.
I don't use JavaMail, but I do know that you must send a "." on a line all by itself before sending out the "QUIT" command. It is surprising that you received the 250 reply. I would expect you to receive a reply code in the 500's if the sending failed.
Aaron
Krzysztof Kwiatek
Greenhorn

Joined: Jan 14, 2004
Posts: 2
hi you write too much code. To send email only you need to type
Transport.send(message);
my example:
Properties props = new Properties();

Authenticator auth = new MyAuthenticator();
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.host", host);
Session session = Session.getDefaultInstance(props, auth);
session.setDebug(true);
try {
// create a message
MimeMessage msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
InternetAddress[] address = {new InternetAddress(to)};
msg.setRecipients(Message.RecipientType.TO, address);

msg.setSubject(temat);
// create and fill the first message part
MimeBodyPart mbp1 = new MimeBodyPart();
mbp1.setText(cialo);

Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp1);
//mp.addBodyPart(mbp2);
// add the Multipart to the message
msg.setContent(mp);
// set the Date: header
msg.setSentDate(new Date());

// send the message
Transport.send(msg);
Krzysztof Kwiatek
Greenhorn

Joined: Jan 14, 2004
Posts: 2
} catch (MessagingException mex) {
mex.printStackTrace();
Exception ex = null;
if ((ex = mex.getNextException()) != null) {
ex.printStackTrace();
}

} catch (Exception e) {
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java mail error SendFailedException
 
Similar Threads
sending mail using javamail and gmail smtp
Urgent!! Please Help Java Mail & WAS problem
Problem with sending mails
SMTP protocol : please help !
javax.mail.NoSuchProviderException: smtp