On Fri, Jul 26, 2013 at 10:31 PM, Pablo Tuñón <[email protected]>wrote:
> I am trying to make my simple application send mails to myself.
> I copied the example code from Mail API and 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)
>>
>
>
Hello Pablo,
Try using the low level App Engine Mail API directly. The following code
will create an email and send it to the registered admins of the
application:
MailService.Message message = new MailService.Message();
message.setSubject("subject line here");
message.setTextBody("the body of the message");
message.setSender("the address this email is from");
MailServiceFactory.getMailService().sendToAdmins(message);
Don't forget to import the following package:
https://developers.google.com/appengine/docs/java/javadoc/com/google/appengine/api/mail/package-summary
-----------------
-Vinny P
Technology & Media Advisor
Chicago, IL
App Engine Code Samples: http://www.learntogoogleit.com
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.