I'm trying to send an email using the java api. I've got my app running live, no custom domain, in fact it's just a default project. Billing is not enabled. My app name is 'testapp'.
I'm using this email address for the sender:
admin#testapp.appspotmail.com
That seems to be ok if I'm reading the docs correctly (criteria #2):
For security purposes, the sender address of a message must be one of the following:
The Gmail or Google Apps Account of the user who is currently signed in
Any email address of the form anything#appname.appspotmail.com or anything#appalias.appspotmail.com
Any email address listed in the Cloud Platform Console under Email API Authorized Senders
The email was sent successfully twice, but now it has stopped working (same sender address, same recipient address). Nothing appears in the recipient's spam.
I can see in the quota page that the # of emails-sent keeps incrementing. But nothing is actually going through.
What am I missing?
Thanks
This is a known issue that is currently being tracked on the App Engine public issue tracker. Please feel free to star this issue for updates.
Related
My company has an application that was verified through the Google OAuth Review/Verification process and is listed as "Published" in the Cloud Console; however, end users are starting to receive the "This app isn't verified" warning when needing to re-authorize.
We tried emailing them Google Cloud Platform/API Trust & Safety Team directly but immediately received the reply "Please note that your email was not received because api-dev-oauth-verification#google.com is not a monitored alias."
Since the application is verified in the console, the "Submit for verification" button is greyed out so we can't contact them that way and we don't want to modify the scopes to require verification again as we want to preserve everything so Google can investigate it in its current state.
That's why I'm reaching out here:
Has anyone experienced this before and have any ideas what could be the cause?
Anyone know a way to reach the Google Cloud Platform/API Trust & Safety Team without the use of "Submit for verification" button?
You are receiving the "api-dev-oauth-verification#google.com is not a monitored alias." message because the address you are trying to send the email to, is a bit wrong.
The correct address to contact the trust and safety team is:
**
api-oauth-dev-verification#google.com
**
Remember that only the project owner should contact the T&S team.
I'm trying to change "When replying to a message" (card "Accounts", section "Send mail as") to "Reply from the same address to which the message was sent" in Gmail Settings" by Gmail API (using service account that was delegated domain-wide authority) and I cannot find it in the docs (https://developers.google.com/gmail/api/v1/reference/users/settings/sendAs).
To explain why I want to do this: I'm adding certain role based Google Groups my users are member of to their send email as preferences (by the service account with domain wide authority). For example, users responsible for dealing with legal# address are member of Google Group called legal and they have legal mails in their mailbox. When responsible users change, I just change the membership and new users receive the mails. The problem is that just the first email comes to legal# and reply goes from john.smith# for example. Because of that, I decided to have them reply from legal#, so those who requests something from Legal Departament knows they are communicating with whole Legal Departament and not Mr Smith only. But when Gmail doesn't automatically choose correct address when replying to the legal mail, it doesn't do what I'm trying to do.
It doesn't matter for me if I change it in admin console or by script running on all users. I wasn't able to use any of those ways.
Thank you for your help,
Martin
I'm pretty certain that Gmail setting ("always reply from xx#yy, or reply from the same address to which the message is sent") is not available in the Gmail API. It really is a client-side issue, since the email client chooses the "From:" line when composing each message or reply.
For your issue, you should be able to use Google groups as a collaborative inbox, see: https://support.google.com/a/answer/167430?hl=en
This user note explains your use case, see: https://productforums.google.com/forum/#!topic/apps/siprUn9Nm9g
Here's the situation: I have successfully set up email to come from a custom domain on App Engine before, but that was always done through the Google Apps for Business set up process. This time I have added the custom domain through the new developers console instead (https://console.developers.google.com/project/[APP_ID]/appengine/settings/domains) and now I'm getting the "unauthorized sender" error every time.
I've tried a lot of variations on the set up process, checked for typos or other potential bugs repeatedly, and scoured both the docs and Stack Overflow without finding an answer. Most of the docs and answers that come up seem woefully out of date. The docs hardly ever reference the new developer console or the fact that Google Apps for Business doesn't have a free tier any more. And most of the answers seem to ignore the fact that the docs (https://cloud.google.com/appengine/docs/python/mail/sendingmail) explicitly state that "Domain accounts do not need to be explicitly verified, since you will have verified the domain during the registration process."
So has anyone actually gotten domain accounts to work with the new process? Do I have to modify DNS records? DKIM? Something else I'm missing? Any insight would be much appreciated.
As stated in the docs:
For security purposes, the sender address of a message must be the
email address of an administrator for the application or any valid
email receiving address for the app (see Receiving Mail). The sender
can also be the Google Account email address of the current user who
is signed in, if the user's account is a Gmail account or is on a
domain managed by Google Apps.
So only logged in Google accounts or admin (owners in the new console) addresses can be used to send emails through GAE. If you want to use a set of custom domain addresses you can either:
1) Add and validate all those addresses as owners in the project's "permissions" settings.
2) Use as external party to send your emails through a Web API, EG Sendgrid which gives you 25.000 emails/month for free for GAE developers (https://cloud.google.com/appengine/docs/python/mail/sendgrid)
my application deployed on app engine has been working succesfully half a year. One function is a sending of emails. But today it started to fail everytime with this error:
javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Illegal Arguments (java.lang.IllegalArgumentException: Unauthorized Sender: Unauthorized sender))
Of course sender email is registered in app engine console.
I didn't change anything!
Anyone who share same issue?
If someone have the same problem, the reason is the sender for the mail is incorrect or doesn't have permissions to send the email, I use the default noreply#your-application-id.appspot.com account to send the email.
InternetAddress from = new InternetAddress(
String.format("noreply#%s.appspotmail.com", SystemProperty.applicationId.get()),
"Your Application Name") ;
message.setFrom(from);
You can check if the account of your user is not marked as a spammer or disabled in Google Apps.
If you are sending a very large number of emails to a single email account, Google can throttle you. When we were sending emails whenever we got an error, we ran into a similar problem.
Also, there is a limit on number of calls to mail API per minute.
Maybe earlier you were sending mail to fewer people resulting in fewer calls to the mail api.
It's 8 calls per minute, unless you have provided a credit card number to enable your billing.
Does your sender email address has permission to access this app engine application ?
it's must have permission to access your application then it will work...
I am having trouble sending email from my app at Google App Engine. I am experiencing several newbee hurdles and I would appreciate your help.
I take this function from the tutorial and for the "sender" field I put my gmail account that I used to create the app:
mail.send_mail(sender="owners_email_acco...#gmail.com",
to="xxxx...#gmail.com",
subject="test email from app",
body="hello")
when I try this, I get the error:
InvalidSenderError: Unauthorized sender
But the email
sender="owners_email_acco...#gmail.com",
is the email I use to log into the app; this is the email I used to create the app.
The tutorial says:
The email address of the sender, the From address. The sender address must be one of the following types: The address of a registered administrator for the application. You can add administrators to an application using the Administration Console.
So the email I used to create the app should work as a sender. What am I doing wrong? Thanks.
(I asked the same question in GAE group but there was no reply)
I read that aliases and nicknames through google apps won't be recognised as their underlying address so maybe that's the problem.
I approached this just a few days ago and after making sure all sender addresses were listed in the 'permissions' section of the application console, it all worked fine.