Class LocalMailService

java.lang.Object
com.google.appengine.tools.development.AbstractLocalRpcService
com.google.appengine.api.mail.dev.LocalMailService
All Implemented Interfaces:
LocalRpcService

@AutoService(LocalRpcService.class) public final class LocalMailService extends AbstractLocalRpcService
Stub implementation of the Google App Engine mail api. This implementation logs messages using a Logger associated with this class and keeps messages that were sent in memory. If you want to access the list of sent messages you can get ahold of the registered LocalMailService instance as follows:
 ApiProxyLocal proxy = (ApiProxyLocal) ApiProxy.getDelegate();
 LocalMailService mailService =
     (LocalMailService) proxy.getService(LocalMailService.PACKAGE);
 
You can then access the list via getSentMessages() and clear the list via clearSentMessages(). By default, messages are logged at Level.INFO and the body of the message is excluded. The log level and whether or not the body of the message is logged can be configured. See LOG_MAIL_BODY_PROPERTY and LOG_MAIL_LEVEL_PROPERTY for more information.