2

Is there any free way to send email from an app, without getting "Suspicious sign in prevented"?

Currently, I'm creating a dummy GMail account, to send email from my app using the following described way : https://stackoverflow.com/a/3649148/72437

However, once in a while, due to heavy usage by my app users from different location, certain message will fail to send. I get the following message from Google :

Hi xxx,

Someone recently tried to use an application to sign in to your Google Account - xxx@gmail.com.

We prevented the sign-in attempt in case this was a hijacker trying to access your account. Please review the details of the sign-in attempt:

Is there any alternative way I can try out, so that I can always send email successfully from my app?

Community
  • 1
  • 1
Cheok Yan Cheng
  • 47,586
  • 132
  • 466
  • 875
  • Make a Web service request to your Web server, and have it send the email. – CommonsWare Aug 17 '13 at 15:52
  • 1
    I do not own a web server so far. – Cheok Yan Cheng Aug 17 '13 at 16:00
  • By the way, what is the nature of the emails your app is sending? Perhaps there are other alternatives. Does it have to be automated or can it be opened in the mail composer before sending? What kind of data does it contain? When / how often is it sent? – Jason C Aug 18 '13 at 13:32
  • @JasonC It is kind of feedback form, which looks like this : http://yccheok.blogspot.com/2013/07/bugs-feature-requests-for-jstock-android.html – Cheok Yan Cheng Aug 18 '13 at 18:31

3 Answers3

4

Sending email for free is going to be difficult for two reasons:

  1. Everybody wants to do it, so it's not free, and

  2. The services that are still free are favorite services for junk mailers and are generally blacklisted in spamfilters, have ads inserted in the emails, etc.

You can either continue doing what you're doing, using services like GMail that mostly work for you but fail every once in a while (as you are seeing), or suck it up and do one of the following:

  1. Get a cheap email hosting account somewhere that has either no or very loose send quotas and rate limits (although note you may have to hunt around a little, as even many paid services impose strict quotas to prevent their services from being used by spammers).

  2. Get a web hosting (and optionally email) account somewhere, write a web application that is responsible for sending the emails, and have your app make requests to that. That has the advantage of you not having to hard code your email account login credentials in all your apps, and also since all of the mail is going through the same point, you can queue mails and apply your own rate limiting so as not to exceed your email service quotas. If you get a package deal with hosted email too, you'll have the ability to manage many different email addresses.

  3. If you have a reliable internet connection and an ISP that lets you run mail or web servers, find a cheap old PC somewhere, buy a domain name, and set up your own mail server (plenty of free SMTP servers out there).

  4. Find an alternate way of delivering your data that isn't email. This of course depends on the nature of the data you are sending.

With the host I'm using now (I'm avoiding naming names because I don't want this to turn into a big ad fest), I pay $10.00/mo for their medium-grade shared hosting package, I get 500GB on a web server (w/ HTTPS support although certs are not free), a Tomcat server, Ruby on Rails support, 2500 email addresses, 50 FTP accounts, and a MySQL database w/ phpMyAdmin in a peaaar treeeee. * ahem * It's quite useful.

Like I mentioned above, you could also continue using GMail or finding other services here and there like that -- email services designed for a single average user that you are kind of kludging to work with an automated system. And that could be totally acceptable. If you don't mind losing a message here and there, then what you are doing is totally reasonable. However, if you want to avoid missing messages like that, you're going to have to switch to a service that is designed to do what you are trying to do, and most of those services will cost money. Personally, I feel like the $120/yr I pay is a bargain.

Jason C
  • 38,729
  • 14
  • 126
  • 182
  • But even if I develop my own web application, I still need to provide some sort of "login credentials"? If not, other apps can simply send their email using my web app. – Cheok Yan Cheng Aug 18 '13 at 18:34
4

I used this code on OpenShift for sending mails:

https://stackoverflow.com/a/3649148/72437

and Google prevented any login attempt over smtp with additional email information "Suspicious sign in prevented".

That's because OpenShift servers are located in USA and email was created in Europe.

Solution is to use this url:

https://accounts.google.com/b/0/DisplayUnlockCaptcha

and send email over smtp immediately after using this url.

If your server does not have static ip/location (f.e. cloud Google App Engine), then it is not solution for you.

Community
  • 1
  • 1
Martin Sznapka
  • 829
  • 11
  • 6
3

Just navigate to https://myaccount.google.com/security and login with your Gmail credentials.

Once you are logged in, Update the field "Allow less secure apps:" to Yes. This will allow you to send without any issues.