Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
Run msgsend.java with Gmail SMTP Server
How to run msgsend.java in javamail1_4_7.zip with Gmail using SSL SMTP protocol? I have a valid Gmail email account.
✍: FYIcenter.com
msgsend.java in javamail1_4_7.zip can be used to send out a simple text mail message through Gmail server using SSL SMTP protocol. Here is an execution session of folderlist.java:
fyicenter>cd \local\javamail-1.4.7\demo
local\javamail-1.4.7\demo>java -version
java version "1.8.0_45"
local\javamail-1.4.7\demo>javac -cp ..\mail.jar msgsend.java
-Dmail.smtp.ssl.enable=true msgsend
-d -M smtp.gmail.com john@yahoo.com
To: john@yahoo.com
Subject: Test
DEBUG: setDebug: JavaMail version 1.4.7
Test
^Z
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.s
mtp.SMTPTransport,Oracle]
DEBUG SMTP: useEhlo true, useAuth false
DEBUG SMTP: trying to connect to host "smtp.gmail.com", port 465, isSSL true
220 smtp.gmail.com ESMTP i125sm23950046ywe.28 - gsmtp
DEBUG SMTP: connected to host "smtp.gmail.com", port: 465
EHLO localhost
250-smtp.gmail.com at your service, [...]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
DEBUG SMTP: Found extension "SIZE", arg "35882577"
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "AUTH", arg "LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN O
AUTHBEARER XOAUTH"
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "CHUNKING", arg ""
DEBUG SMTP: Found extension "SMTPUTF8", arg ""
DEBUG SMTP: use8bit false
MAIL FROM:<john@localhost>
530-5.5.1 Authentication Required. Learn more at
530 5.5.1 https://support.google.com/mail/answer/14257 i125sm23950046ywe.28 - g
smtp
DEBUG SMTP: got response code 530, with response: 530-5.5.1 Authentication
Required. Learn more at
530 5.5.1 https://support.google.com/mail/answer/14257 i125sm23950046ywe.28 - g
smtp
RSET
250 2.1.5 Flushed i125sm23950046ywe.28 - gsmtp
DEBUG SMTP: MessagingException while sending, THROW:
com.sun.mail.smtp.SMTPSendFailedException: 530-5.5.1 Authentication Required. Le
arn more at
530 5.5.1 https://support.google.com/mail/answer/14257 i125sm23950046ywe.28 - g
smtp
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2
108)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1609)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1117)
at javax.mail.Transport.send0(Transport.java:195)
at javax.mail.Transport.send(Transport.java:124)
at msgsend.main(msgsend.java:188)
QUIT
The output shows that:
⇒ Older Versions of JavaMail Library
⇐ msgsend Demo Program in JavaMail 1.4.7
2016-01-27, ∼3421🔥, 0💬
Popular Posts:
JDK 17 jdk.jdi.jmod is the JMOD file for JDK 17 JDI (Java Debug Interface) tool. JDK 17 JDI tool com...
How to download and install JDK (Java Development Kit) 8? If you want to write Java applications, yo...
SLF4J API is a simple API that allows to plug in any desired logging library at deployment time. Her...
JDK 11 jdk.internal.opt.jmod is the JMOD file for JDK 11 Internal Opt module. JDK 11 Internal Opt mo...
JDK 11 jdk.jshell.jmod is the JMOD file for JDK 11 JShell tool, which can be invoked by the "jshell"...