OK - I got it working now.

I adjusted my classpath

I don't know why this matters but I now have the following JAR files
Listed before commons-email-1.0.jar

activation.jar
mail.jar
smtp.jar 

Now that I have it running locally the fun begins to have it work on
A Unix server.  Woo hoo!

Allan

-----Original Message-----
From: Flatoff Allan [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 29, 2005 10:08 AM
To: Jakarta Commons Users List
Subject: [email] EmailException caused by NoSuchProviderException

I'm using commons-email-1.0

when I execute email.send(); an EmailException is thrown
detailMessage: Sending the email to the following server failed :
mail.sentry.com:25
rootCause: javax.mail.NoSuchProviderException: smtp

mail.sentry.com is the correct smtp server.

I'm running my application from within WebSphere Studio ( java
development environment based on eclipse )

Here is the stack trace:

org.apache.commons.mail.EmailException: Sending the email to the
following server failed : mail.sentry.com:25
        at org.apache.commons.mail.Email.sendMimeMessage(Email.java:873)
        at
com.sentry.BatchClaimOdsUpdate.BatchClaimOdsUpdate.main(BatchClaimOdsUpd
ate.java:85)
Caused by: javax.mail.NoSuchProviderException: smtp
        at javax.mail.Session.getService(Session.java:614)
        at javax.mail.Session.getTransport(Session.java:543)
        at javax.mail.Session.getTransport(Session.java:484)
        at javax.mail.Session.getTransport(Session.java:464)
        at javax.mail.Session.getTransport(Session.java:519)
        at
com.sentry.BatchClaimOdsUpdate.BatchClaimOdsUpdate.main(BatchClaimOdsUpd
ate.java:85)

I'm doing nothing unusual here and I'm not sure why its failing.  Here's
the code snippet:

        SimpleEmail email = new SimpleEmail();
        email.setHostName(emailHost);
        email.addTo(notifyIfOdsUnsuccessEmail);
        email.setFrom(fromEmailAddress, fromEmailName);
        email.setSubject(notifyIfOdsUnsuccessSubject);
        email.setMsg(odsErrorEmailBody);
        email.send();

Any insight you might offer is appreciated.

Thank you,
Allan


This e-mail is confidential.  If you are not the intended recipient, you
must not disclose or use the information contained in it.  If you have
received this e-mail in error, please tell us immediately by return
e-mail to [EMAIL PROTECTED] and delete the document.

E-mails containing unprofessional, discourteous or offensive remarks
violate Sentry policy. You may report employee violations by forwarding
the message to [EMAIL PROTECTED]

No recipient may use the information in this e-mail in violation of any
civil or criminal statute. Sentry disclaims all liability for any
unauthorized uses of this e-mail or its contents.

This e-mail constitutes neither an offer nor an acceptance of any offer.
No contract may be entered into by a Sentry employee without express
approval from an authorized Sentry manager.

Warning: Computer viruses can be transmitted via e-mail. Sentry accepts
no liability or responsibility for any damage caused by any virus
transmitted with this e-mail.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



This e-mail is confidential.  If you are not the intended recipient, you must 
not disclose or use the information contained in it.  If you have received this 
e-mail in error, please tell us immediately by return e-mail to [EMAIL 
PROTECTED] and delete the document.

E-mails containing unprofessional, discourteous or offensive remarks violate 
Sentry policy. You may report employee violations by forwarding the message to 
[EMAIL PROTECTED]

No recipient may use the information in this e-mail in violation of any civil 
or criminal statute. Sentry disclaims all liability for any unauthorized uses 
of this e-mail or its contents.

This e-mail constitutes neither an offer nor an acceptance of any offer. No 
contract may be entered into by a Sentry employee without express approval from 
an authorized Sentry manager.

Warning: Computer viruses can be transmitted via e-mail. Sentry accepts no 
liability or responsibility for any damage caused by any virus transmitted with 
this e-mail.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to