This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes puzzled with SendFailedException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "puzzled with SendFailedException" Watch "puzzled with SendFailedException" New topic
Author

puzzled with SendFailedException

miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
i have my send mails code working nicely: i send and receive all mails sent by my program
yet, i noticed i receive a:
javax.mail.SendFailedException: No recipient addresses
at javax.mail.Transport.send0(Transport.java:128)
at javax.mail.Transport.send(Transport.java:98)
and so on

but as i debug, the process goes on and eventually i get the email message
i went on reading the API and, i quote:

public class SendFailedExceptionextends MessagingException
This exception is thrown when the message cannot be sent.

The exception includes those addresses to which the message could not be sent as well as the valid addresses to which the message was sent and valid addresses to which the message was not sent.

i dont get it at all: so, everytime one sends a message, this error message appears either there is or there is not a valid address?

the complete stacktrace:

javax.mail.SendFailedException: No recipient addresses
at javax.mail.Transport.send0(Transport.java:128)
at javax.mail.Transport.send(Transport.java:98)
at gui.EnviarEMail.<init>(EnviarEMail.java:32) // Transport.send(msg);
at util.ListenerUtil$38.actionPerformed(ListenerUtil.java:533)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)

DEBUG: JavaMail version 1.4ea
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

DEBUG: java.io.FileNotFoundException: C:\Programas\Java\jre6\lib\javamail.providers (O sistema não conseguiu localizar o ficheiro especificado) // SYSTEM COULD NOT FIND THE ESPECIFIED FILE
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.providers
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.address.map
DEBUG: java.io.FileNotFoundException: C:\Programas\Java\jre6\lib\javamail.address.map (O sistema não conseguiu localizar o ficheiro especificado)
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 SMTP: trying to connect to host "smtp.gmail.com", port 465, isSSL false
220 mx.google.com ESMTP 7sm6069532eyb.34
DEBUG SMTP: connected to host "smtp.gmail.com", port: 465

EHLO XXX
250-mx.google.com at your service, [XXX]
250-SIZE 35651584
250-8BITMIME
250-AUTH LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250 PIPELINING
DEBUG SMTP: Found extension "SIZE", arg "35651584"
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "AUTH", arg "LOGIN PLAIN"
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Attempt to authenticate
AUTH LOGIN
334 VXNlcm5hbWU6
cmFmYWVsLnNhY3JhbWVudG9AZWJpdmdhbWEucHQ=
334 UGFzc3dvcmQ6
MTIzNDU2
235 2.7.0 Accepted
DEBUG SMTP: use8bit false
MAIL FROM:<XXX>
250 2.1.0 OK 7sm6069532eyb.34
RCPT TO:<XXX>
250 2.1.5 OK 7sm6069532eyb.34
DEBUG SMTP: Verified Addresses
DEBUG SMTP: XXX
DATA
354 Go ahead 7sm6069532eyb.34
From: XXX
To: XXX
Message-ID: <2329159.11261181327921.JavaMail.XXX>
Subject: com debug
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


.
250 2.0.0 OK 1261181330 7sm6069532eyb.34
QUIT
221 2.0.0 closing connection 7sm6069532eyb.34


java amateur
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
case solved!
without noticing i uncommented this piece of code:

and of course there were no adresses at all
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: puzzled with SendFailedException
 
Similar Threads
javax.mail.NoSuchProviderException: smtp
Unknown SMTP host exception in java mail.
problem sending mail to other domains
My Application is not sending mail to external servers
Java mail