This code works for me
public class SivamServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
resp.setContentType("text/plain");
UserService userService = UserServiceFactory.getUserService();
if (userService.getCurrentUser() == null ||
!userService.isUserAdmin
())
resp.sendRedirect(userService.createLoginURL(req.getRequestURI()));
else {
try {
MailService.Message message = new
MailService.Message();
message.setSubject(" This is the Test Message
");
message.setTextBody(" TEST MESSAGE ");
message.setTo("[email protected]");
message.setSender(userService.getCurrentUser().getEmail());
MailService ms =
MailServiceFactory.getMailService();
ms.send(message);
} catch( Exception e ) {
resp.getWriter().println(e.getMessage());
}
resp.getWriter().println("Hello, world");
}
}
}
On Aug 19, 10:47 am, DrMorten <[email protected]>
wrote:
> I sent about 7 emails last night to my own email address. They havnt
> arrived, Ive checked the code and the addresses were right. The Quotas
> say that I've sent the e-mails.
>
> Anyone have an idea of how long it should take to send to a gmail
> address?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en
-~----------~----~----~----~------~----~------~--~---