Hi,
I'm trying to send a email using JAVA mail API.
I downloaded the mail.jar and the activation.jar and put in classpath.
However when i try to execute my code
I have the following error:
Why is calling the Google AppEngine?
Do i need more jars?
Thanks in advance.
I'm trying to send a email using JAVA mail API.
I downloaded the mail.jar and the activation.jar and put in classpath.
However when i try to execute my code
Code:
public String register() { try { // Setup mail server Properties props = System.getProperties(); props.put("mail.smtp.host", "pop3.gmail.com"); // Get a mail session Session session = Session.getDefaultInstance(props, null); // Define a new mail message Message message = new MimeMessage(session); message.setFrom(new InternetAddress("from@gmail.com")); message.addRecipient(Message.RecipientType.TO, new InternetAddress("to@gmail.com")); message.setSubject("Some Subject"); // Create a message part to represent the body text message.setText("Some Message"); // Send the message Transport.send(message); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }
I have the following error:
Code:
com.google.apphosting.api.ApiProxy$CallNotFoundException: The API package 'mail' or call 'Send()' was not found. at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:70) at com.google.appengine.api.mail.MailServiceImpl.doSend(MailServiceImpl.java:96) at com.google.appengine.api.mail.MailServiceImpl.send(MailServiceImpl.java:33) at com.google.appengine.api.mail.stdimpl.GMTransport.sendMessage(GMTransport.java:247) at javax.mail.Transport.send(Transport.java:95)
Why is calling the Google AppEngine?
Do i need more jars?
Thanks in advance.
Comment