Gmail api credential files - gmail-api

I have integrated my .net application to send e-mails from Gmail, I have 5 mail accounts that now send e-mails.
For every e-mail account I have created the credential file, when the application is running the first time I most enter the credentials from the e-mail to authenticate itself.
For sending a mail from Gmail you must passed trough the correct json file, that's is created for the specific mail-account.
This has worked for the last 5 months, but now it is not possible to send any e-mails.
Now the credential files are mixed-up, when the mail is automatically send i recieve and 403 that i'm not authenticated. But the email that is given is one of the others mail accounts.
I don't recieve the consist popup to authenticate it self anymore.
Have anyone has the same issue?
regards

Related

Not received emails even though the SendGrid activity shows Delivered

I have created Azure Logic App with Recurrence trigger and then used SendGrid connector for sending emails to multiple team members.
I didn’t receive any email even though the logic app actions executed successfully. After that I have checked SendGrid account email activity status, it is having “Delivered” status for the mentioned to email address in the SendGrid action.
Note: I have whitelisted the Outbound IP address of my logic app in SendGrid IP Address Management.
Twilio SendGrid developer evangelist here.
I don't know how Azure Logic Apps trigger emails with SendGrid, but if an email isn't being sent they shouldn't be getting the "Delivered" status.
You said that you have not set up Single Sender Verification or Domain Authentication. In order to send an email using SendGrid from the email address you provide, that email address should either have been verified as a Single Sender (which is mostly useful for testing) or it should be from a domain that you have authenticated with SendGrid.
Try setting one of those verification methods up and then try sending emails again.

GMail API - Can I send email using the Service Account?

When I send an email using the GMail API, I get an Access Token for the user to whom the message is to be sent and then when sending the message, I put some value in the From Field.
But no matter what I put in the from field, the message in the email shows as From "Me" and is in the Sent mails as well as Inbox.
Is there a way, I could use the Service Account to send the email, so that it does not show up as From "Me" and is also not in the Sent Mails.
You cannot use a service account to impersonate a free gmail account. I spent a lot of time confirming this after reading a reply that was here before. Maybe it worked at some point, but it doesn't anymore.
There is no way to share / grant another user permission to access
your standard gmail account. So there is no way for you go delegate
the permissions for bob#mycompany.com to access bob#gmail.com.
and
you can impersonate G-Suite accounts but not Gmail accounts
These quotes are from Google's official C# Auth repo:
https://github.com/googleapis/google-api-dotnet-client/issues/1561
No. The Gmail API is for Gmail users and service accounts are just for doing auth to a real Gmail account, they don't have their own Gmail account, etc.
If you want to send the email from some service, you need some bulk-sending email service like at: https://cloud.google.com/compute/docs/tutorials/sending-mail/ or something you run yourself or from some other provider.
No, what you are looking for is a bulk email sending service. Checkout sendgrid , Amazon AWS SES, mandrill or if you want to stick with Google, this. You could of course run your own postfix server (although I'm assuming you were using gmail api for deliverability in the first place.

How to forward emails from Google Apps (Gmail) to Sendgrid?

I am trying to use Sendgrid as SMTP server for sending all emails from my users using Google Apps for email.
The catch is that Sendgrid requires password authentication and i couldn't find a way in Google apps Admin console to out that in (theough of coruse, there are ways to enter the SMTP server IP, but it doesn't work).
How to hook SendGrid to Free Gmail account (Not Google for work account)?
See: https://support.google.com/mail/answer/22370?hl=en
Click the gear in the top right.
Select Settings.
Click the Accounts and Import tab.
Under Send mail as, click Add another email address.
Click Add account >>
Give a descriptive name to this new "email transmitter" (e.g. "Send mails via SendGrid")
Give any email address that belong to you but not a GMAIL email (e.g myemail#mydomain.com)
Uncheck the Alias check mark
Change your SMTP to smtp.sendgrid.net
Use ports 587 for plain/TLS connections .
SendGrid username (sendgridname)
SendGrid password (sendgridpassword)
Gmail will send you a verification email to the "transmitter email" (e.g to myemail#mydomain.com)
Open your other account (mantas.hof.hefer#hhcc.org.il) and either click the link in the message Gmail sent or enter the confirmation code in the Accounts and Import section of your Gmail settings.
Whenever you want to send email from Gmail via SendGrid when you compose the email, in the “from” field select the SendGrid email (rami via SendGrid).
The will be send as like it has been send from the “email transmitter” (e.g it will send to myemail#mydomain.com).
Type the verification code and you are set.
Next time you want to compose an email from Gmail please select the field "FROM" and choose the new "transmitter email" (e.g. "Send mails via SendGrid"). Write your email and send it. It will be send via SendGrid.
If you login into your SendGrid account you can find many statistics on this email such as how many people have open this email. (https://sendgrid.com/logs/index).
The only thing that I couldn't figure is how use the SMTP protocol from GOOGLE JAVASCRIPT (not java) in order to manipulate my emails.
There are many SendGrid SMTP commands that can be added to the message headers but I couldn't figure how to do it.
The sendgrid API auth's from within the request. Simply use UrlFetch to send POST requests containing your API creds to the sendgrid endpoint.
If anyone comes across this answer as I did via a Google search, this update might help. The answer provided by #rmisegal is basically correct but you now use an API key from SendGrid.
You can setup an SMTP email API key via the SendGrid dashboard:
Log into your sendGrid Account.
Click on your account name in the top left of the dashboard and select Setup Guide from the drop down menu.
Press the start button next to the "Integrate using Web API or SMTP relay"
Follow the wizard steps to create your API key.
Follow the instructions provided rmisegal except provide a user name of apikey and use the apiKey from SendGrid as the password.

What's the difference between username and from in JavaMail

When sending mail, the username and password should be given to get access to the mail server. And then why "from" is still needed.
Depending on your mail server, you might be allowed to authenticate as one user, but then send mail as several other users. For example, you might want to log in as yourself and then send out your company newsletter as "newsletter#company.com".

How can my appengine app send mail using the senderid of domain that installed the app

Say I have an appengine app called foo at foo.appspot.com and my email i.e. adminfoo(at)gmail.com is it's adminstrator.
Now, I want to sell this service to blah.com. blah.com has a google app account and 'adds' the foo application and sets the url http://foo.blah.com to point to it.
Now, using the new namespace manager, I carve out separate data for blah.com but when blah.com wants to send out email currently the only way it is possible is either
sender is admin i.e. adminfoo (at) gmail.com
or foo.appspot.com has to add someone(#)blah.com as a developer
Is there any other way? What happens if one has 1,000's of customers ?
Also, the docs state that the email sender can be 'the currently logged in user'. So, if someone(at)blah.com were to 'login' using the google login and 'stay logged in to the app' than can the app send email on behalf of someone(at)blah.com with someone(at)blah.com being the sender?
The other way is that your app can send email as anything#appid.appspotmail.com, where 'appid' is its App ID. As you say, you can also send email as the logged in user - but only on requests made by that user - so sending mail as them from the Task Queue is out.
You might want to look into an 3rd party E-Mail provider. We use http://postmarkapp.com/ for our AppEngine projets (via huTools.postmark) and we love it.

Resources