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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "problem about java mail" Watch "problem about java mail" New topic
Author

problem about java mail

S. M. Sabbir
Greenhorn

Joined: Feb 15, 2009
Posts: 21
i like to use java mail in my application, and first time i try it through this code



which generates following output:


DEBUG: setDebug: JavaMail version 1.4.2
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth false
DEBUG SMTP: trying to connect to host "smtp.gmail.com", port 25, isSSL false
220 mx.google.com ESMTP 15sm538581fxm.14
DEBUG SMTP: connected to host "smtp.gmail.com", port: 25

EHLO Sabbir-PC
250-mx.google.com at your service, [117.18.231.27]
250-SIZE 35651584
250-8BITMIME
250-STARTTLS
250-ENHANCEDSTATUSCODES
250 PIPELINING
DEBUG SMTP: Found extension "SIZE", arg "35651584"
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "STARTTLS", arg ""
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: use8bit false
MAIL FROM:<sadimohammads@gmail.com>
530 5.7.0 Must issue a STARTTLS command first. 15sm538581fxm.14
DEBUG SMTP: got response code 530, with response: 530 5.7.0 Must issue a STARTTLS command first. 15sm538581fxm.14

RSET
250 2.1.5 Flushed 15sm538581fxm.14
com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. 15sm538581fxm.14

at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1668)
com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. 15sm538581fxm.14

at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1207)
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1668)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1207)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:735)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:735)
at javax.mail.Transport.send0(Transport.java:191)
at javax.mail.Transport.send0(Transport.java:191)
at javax.mail.Transport.send(Transport.java:120)
at javax.mail.Transport.send(Transport.java:120)
at MyMail.main(MyMail.java:33)
at MyMail.main(MyMail.java:33)
QUIT
221 2.0.0 closing connection 15sm538581fxm.14

and no mail sent to my id.......
please can someone help me??
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
You got some of the details wrong, and the code is also missing authentication. See http://java.sun.com/products/javamail/FAQ.html#gmail


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem about java mail