• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

problem about java mail

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:<[email protected]>
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??
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Space pants. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic