views:

72

answers:

1

Is there a way to change the From email address to another email address in google app engine. Right now I want to send from addresses in my domain that is linked to google app engine, not the email address or the main address. ie: my account address is [email protected] but I want the email to come from [email protected].

thanks,

+1  A: 

Here the documentation

Here is the relevant section:

Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress("[email protected]", "Example.com Admin"));

A little farther down it states a caveat:

To set the sender address, the app calls the setFrom() method on the MimeMessage object. The sender must be either the address of a registered developer for the application, or the address of the user for the current request signed in with a Google Account.

So you just have to register [email protected] as a developer on your application. This means [email protected] must be a valid email at the time of registration. I am not sure if you can just delete it after registration or not. You can always set up mail rules to delete all email that comes to that account if you want but the directions for that will be mail provider specific.

rancidfishbreath