1

How do I send email from Google App Engine with a random, non-app admin sender using a custom domain name (e.g. xyz@myshop.com ) ? We need to allow the users of our website to communicate with each other through a custom made messaging system but also allow them to reply directly from their email. Something similar with the craigslist system. However seems that GAE doesn't allow us to send email from an address that is not admin. Is there any workaround / patch ? We are the owner of myshop.com domain name (verified through google apps) so I don't see why a such thing is not allowed.

themihai
  • 7,903
  • 11
  • 39
  • 61
  • I would guess, that google doesn't allow this, since spammers might be the number users of that feature... – Jörg Beyer Feb 28 '12 at 20:26
  • That's a lame excuse. The restriction should be on the domain name not the email address. See Amazon SES for a such restriction done right. Paying 3 google apps accounts to send emails from register@domain, messages@domain and marketing@domain sounds like a joke but that's how GAE is currently working. – themihai May 24 '15 at 12:24

3 Answers3

5

While you can't use just any random address, you can use a registered administrator address with a '+' suffix. So you could send the mail with a 'from' of, say, message-reply+HASH_VALUE@myshop.com. Then your app will receive the reply, and can use the hash to decide which user to forward the mail to.

Moishe Lettvin
  • 8,462
  • 1
  • 26
  • 40
  • You should mark [this](http://code.google.com/p/googleappengine/issues/detail?id=2217) bug fixed then. –  Feb 29 '12 at 17:56
2

How about sending the email from your admin account, but adding a reply-to header, specifying the user's email-address?

Klaus Byskov Pedersen
  • 117,245
  • 29
  • 183
  • 222
  • Yes, I was thinking about that but many people copy/paste the email instead to reply. Anyway I think the "reply-to" must also be admin too. – themihai Feb 28 '12 at 20:30
1

Google doesn't allow to use random addresses. You can star this bug.

http://code.google.com/p/googleappengine/issues/detail?id=3069

However, since the users are apparently registered with Google Apps, the system can send emails on their behalf when they are signed into your application.

The sender address must be one of the following types:

...

  • The address of the user for the current request signed in with a Google Account. You can determine the current user's email address with the Users API. The user's account must be a Gmail account, or be on a domain managed by Google Apps.

http://code.google.com/appengine/docs/python/mail/emailmessagefields.html

Community
  • 1
  • 1
  • I starred the issue. The users of our site are not also google apps users so it doesn't help us at all. – themihai Feb 28 '12 at 21:42