Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem about java mail

 
S. M. Sabbir
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You got some of the details wrong, and the code is also missing authentication. See http://java.sun.com/products/javamail/FAQ.html#gmail
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic