Can appengine send email from external SMTP server? - google-app-engine

Our customers want to send emails from our java appengine application using their email accounts, with their smtp servers. Is that possible? Verifying all their email addresses in appengine is NOT an option. Would it be possible to send email from an appengine application using an external SMTP server?
Thank you very much.

No, there's no way for an App Engine app to make a connection to an external SMTP server. If you want to do this, you'll need to find or build a webservice that sends email via an HTTP-based interface.

It's possibly to do today, but requires some indirection. If they set up a web form (cgi script, web app , whatever) that forwards to their SMTP server (after making the appropriate authentication checks, of course), then it's a simple matter for an App Engine app to make a POST.

Related

Reading a users gmail in Google app engine app

I am the admin of a Google domain and I need to he able to read users emails in my php app. How is this possible? I have tried to use IMAP but it won't even connect. Is there something special that apps have to do?
Here is a list of all the ways to read a user's Gmail mailbox, outside of App Engine :
IMAP, as you said. Provided it is enabled on your domain. Most of our customers disable it for security reasons (no audit trace of the connections).
Apps Script, but it requires the user's consent, even if you're an admin
The Email Audit API, but an Email extraction takes approximately 2 weeks (no kidding)
If IMAP is enabled on your domain, then it's the best choice. However, by default GAE does not allow outgoing connections apart from HTTP requests. The workaround for this limitation is the Sockets API, currently in preview. You can check it out here.
Note that you will also need to use an OAuth2 service account (domain-wide delegation) and IMAP-XOAuth2 to authenticate with the IMAP protocol.

Java Remote API and the (Experimental) Federated Login

I've been successfully using the Remote API for Java in a standalone client and some time ago switched my app to use the experimental Federated Login. Now I am getting the can't get appId from remote api; status code = 302 exceptions every time my standalone client connects to the app.
I am looking for a confirmation of whether (or not) the Remote API for Java works with the Federated Login, to know whether the problem is on my side or a current limitation of GAE.
After some additional searching it appears that there's indeed an acknowledged problem with the use of Federated Login and Remote API, accepted as the issue 5165 by the App Engine team.

Send email with Google App Engine and store it in Sent Mail in Gmail

I create a web application in Python for Google App Engine that sends a mail when I make some stuff. I used my Gmail account to send the email and I would like to save that email in my sent mail. It's possible?
No this is not possible since Google App Engine is not directly connected with your Gmail account and in the sent items only items that are sent through Gmail are appearing. As Sebastian Kreft pointed it out, you could sent a copy to yourself and create a filter for it.
I'm not sure if the non delivery reports are coming back on sender's email address, but either case make sure that you have access to that email or set the reply_to field.
You cannot be sure your e-mail will reach it's destination with app engine mail api, because you never receive any information about e-mail delivery from the GAE mail api and you cannot use a return-path.
Because of that I use app engine together with Amazon SES.
Another trick is to use the gmail api of google apps script:
See: https://developers.google.com/apps-script/service_gmail
Apps script is also able to talk to GAE.

Send mail from a different domain in google app engine

I understand from the mail documentation that GAE is limited in who mail can come from when sent by the app. There are options for receiving incoming mail on a different domain (basically having it forwarded) but are there any options for sending mail from an app. Ideally i'd like my app to be able to send mail from a different address for each user in my app, so that when replies were received I could match them up to the user that sent them.
I'd ideally like the emails to come from <userid>#<custom.domain>.com but could live with being able to send them from <userid>#app-id.appspotmail.com.
Do I have any options here?
As far as I know, your only option would be to communicate with an external server that via a URLFetch. The external server would be responsible for sending and receiving email through the usual means and providing a web service interface that your AppEngine app could use.

Can you use Google App Engine to send emails from an application hosted elsewhere?

I need to send emails from my web application (on account creation, password reset, etc.). This application will most likely be hosted on a standard hosting site (or possibly on Amazon EC2), not on Google App Engine.
However, I like the ease of use for sending email through App Engine. Is there a way to host your application elsewhere but use App Engine to send emails programatically? I suppose I could send a web request from my application to a custom application on App Engine, parse the request, and then send the email from App Engine.
However, I would like to avoid having to create an application on App Engine even if it is very simple as it would be another item to maintain. Is there a simpler way to just use App Engine as the email gateway, similar to using Google Apps for my Domain?
I don't need to receive email by the application. Also, I would like all emails to come from the same domain (like mail#example.com) regardless of if it were sent from the hosted application or App Engine.
You can do this using remote_api. Simply upload a Python app with nothing but the remote api handler included; you can then use the Python remote api library to send emails via App Engine.
Note that emails sent by the App Engine Mail API have to be from an administrator of the app (or the logged in user, but this doesn't apply over remote api). Thus, you'll want to add whatever from account you want as an administrator to the app.
Edit: As mentioned, I am totally wrong! Above post is correct.
First, I am very positive if you want to use App Engine's features you need to actually build an app on it. You can't use their API on external applications. You are right though that you could simply send a request to your app engine app if you wanted it to send email. I don't see how it would be too hard to maintain if that's all it is doing.
Second, if you are planning to send emails via GMail's service, they don't allow you to mask the from address so you will always see it from whatever gmail address you're sending it from.
Why not just send emails from your application but use whatever email service you use now? In most languages and frameworks, SENDING email and not managing it is a breeze.

Resources