2

I am getting this error when trying to send emails via gmail smtp inside servlet it works locally when tested but not inside google engine i added the libs under web-inf/libs [activation.jar-smtp.jar- mailapi.jar - mail.jar] any idea how i can fix it!!

Error: javax.servlet.ServletContext log: unavailable java.lang.SecurityException: SHA1 digest error for javax/mail/Message.class at com.google.appengine.run

Code Snapshot:

 Properties props = new Properties();
 props.setProperty("mail.transport.protocol", "smtp");
 props.setProperty("mail.host", "smtp.gmail.com");
 props.put("mail.smtp.auth", "true"); 
 props.put("mail.smtp.port", "465"); 
 //props.put("mail.debug", "true");
 props.put("mail.smtp.socketFactory.port", "465");
 props.put("mail.smtp.socketFactory.class","javax.net.ssl.SSLSocketFactory");
 props.put("mail.smtp.socketFactory.fallback", "false");
 javax.mail.Session sess = javax.mail.Session.getInstance(props);
 Transport transport = sess.getTransport(); 
 transport.connect();
 transport.send(message);
Hardik Mishra
  • 14,779
  • 9
  • 61
  • 96
  • From the excpetion trace it looks like your code is deployed on appengine. If i remember correctly app engine does not allow you to send email. Please recheck the documentation – Anupam Saini Oct 17 '12 at 07:33

1 Answers1

1

You cannot use signed jar files on Google app engine.

As indicated on the web page, you should try to unsign it, specifically the mail.jar because the error is indicating javax/mail/Message.class, see this question for an example

Community
  • 1
  • 1
Alex
  • 25,147
  • 6
  • 59
  • 55