user2966271
user2966271

Reputation: 21

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).

Upvotes: 2

Views: 8237

Answers (3)

Bevan
Bevan

Reputation: 34

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:

  1. Log into your sendGrid Account.

  2. Click on your account name in the top left of the dashboard and select Setup Guide from the drop down menu.

  3. Press the start button next to the "Integrate using Web API or SMTP relay"

  4. Follow the wizard steps to create your API key.

  5. Follow the instructions provided rmisegal except provide a user name of apikey and use the apiKey from SendGrid as the password.

Upvotes: -1

rmisegal
rmisegal

Reputation: 77

How to hook SendGrid to Free Gmail account (Not Google for work account)?

See: https://support.google.com/mail/answer/22370?hl=en

  1. Click the gear in the top right.
  2. Select Settings.
  3. Click the Accounts and Import tab.
  4. Under Send mail as, click Add another email address.
  5. Click Add account >>
  6. Give a descriptive name to this new "email transmitter" (e.g. "Send mails via SendGrid")
  7. Give any email address that belong to you but not a GMAIL email (e.g [email protected])
  8. Uncheck the Alias check mark
  9. Change your SMTP to smtp.sendgrid.net
  10. Use ports 587 for plain/TLS connections .
  11. SendGrid username (sendgridname)
  12. SendGrid password (sendgridpassword)
  13. Gmail will send you a verification email to the "transmitter email" (e.g to [email protected])
  14. Open your other account ([email protected]) 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.
  15. 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).
  16. The will be send as like it has been send from the “email transmitter” (e.g it will send to [email protected]).
  17. 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.

Upvotes: 6

Nick
Nick

Reputation: 3591

The sendgrid API auth's from within the request. Simply use UrlFetch to send POST requests containing your API creds to the sendgrid endpoint.

Upvotes: 0

Related Questions