I have been developing a simple app which is ment to send me emails when a user fills a form.
I have followed tutorials and copied example code. But when I try to run it it throws the following exception:
javax.servlet.ServletContext log: Exception while dispatching incoming RPC call com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract int com.pablo.pabloweb.client.communication.SendEmailService.send(java.lang.String)' threw an unexpected exception: com.google.apphosting.api.ApiProxy$FeatureNotEnabledException: The Socket API will be enabled for this application once billing has been enabled in the admin console. at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:389) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:579) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248) ...
My question is: is there any way to use Mail API without setting up billing details? My application is not likely to overtake the limit, by any means.
In case it is needed, this is the code which causes the exception:
public boolean actualSend(String msgText, String subject) {
Properties props = new Properties();
Session session = Session.getDefaultInstance(props, null);
try {
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress("admin-gmail-email-address"));
msg.addRecipient(Message.RecipientType.TO,
new InternetAddress("another-personal-email-address"));
msg.setSubject(subject);
msg.setText(msgText);
Transport.send(msg);
return true;
} catch (AddressException e) {
return false;
} catch (MessagingException e) {
return false;
}
}