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:<
[email protected]>
DEBUG SMTP RCVD: 250-SIZE 0
DEBUG SMTP SENT: RCPT TO:<
[email protected]>
DEBUG SMTP RCVD: 250-8BITMIME
Verified Addresses
[email protected] 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 = "
[email protected]";
String to = "
[email protected]";
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:
[email protected] to:
[email protected] 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:<
[email protected]>
DEBUG SMTP RCVD: 250-SIZE 0
DEBUG SMTP SENT: RCPT TO:<
[email protected]>
DEBUG SMTP RCVD: 250-8BITMIME
Verified Addresses
[email protected] 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...
------------------