Hello,
I am using Commons Email 1.1 with JavaMail 1.4.1 and Activation Framework 1.1.1
The only documentation I found online about this error was one guy who
had a corrupted jar file. I've redownloaded all three jars multiple
times and I always get the same error. Not sure if there is a checksum
available for them, but I doubt this is the problem... unless a bad
build somehow got published.
When I try to send an e-mail I get the following error (the actual
host is valid and tested via telnet to port 25, xxx here):
Caused by:
com.idc.cms.content.syndication.transports.SyndicationTransportException:
org.apache.commons.mail.EmailException: Sending the email to the
following server failed : relay.xxx.com:25
at
com.idc.cms.content.syndication.transports.EmailTransporter.sendOne(EmailTransporter.java:110)
at
com.idc.cms.content.syndication.transports.PartnerEmailTransporter.send(PartnerEmailTransporter.java:55)
at
com.idc.cms.content.syndication.transports.PartnerEmailTransporter.send(PartnerEmailTransporter.java:43)
at
com.idc.cms.content.syndication.transports.PartnerTransportManager.deliverFileToPartnerViaEmail(PartnerTransportManager.java:79)
... 26 more
Caused by: org.apache.commons.mail.EmailException: Sending the email
to the following server failed : relay.xxx.com:25
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1138)
at org.apache.commons.mail.Email.send(Email.java:1163)
at
com.idc.cms.content.syndication.transports.EmailTransporter.sendOne(EmailTransporter.java:107)
... 29 more
Caused by: java.lang.NoSuchMethodError:
com.sun.mail.util.SocketFetcher.getSocket(Ljava/lang/String;ILjava/util/Properties;Ljava/lang/String;Z)Ljava/net/Socket;
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1359)
at
com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
at javax.mail.Service.connect(Service.java:233)
at javax.mail.Service.connect(Service.java:134)
at javax.mail.Service.connect(Service.java:86)
at javax.mail.Transport.send0(Transport.java:162)
at javax.mail.Transport.send(Transport.java:80)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1128)
... 31 more
The code:
// Create the email message
MultiPartEmail email = new MultiPartEmail();
email.setHostName(host);
email.setSubject(subject);
// Finish the configuration
email.addTo(emailAccount.getAddress(), emailAccount.getName());
email.setFrom(fromAddress, fromName);
email.setMsg(body);
// Add the attachment
email.attach(createAttachment(file));
// Send the email
email.send();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]