Use Google Apps and Mandrill/Sendgrid to send emails - email

Right now I have dilemma with email part of my projects. I'm using Sendgrid to send and receive emails (via webhook). All email functionality is integrated in my web application and all the emails are stored in the database. I want to know is it possible to do next:
Use Google Apps to receive inbound emails for support#domain.com
Use Google Apps to send outbound emails from support#domain.com
Use SendGrid or Mandrill to send outbound transactional and news
emails from noreply#domain.com and news#domain.com
Current problem is in MX records. Both Google and SendGrid MX records are required to be set in my DNS, but as far as I understand only one of them will actually work.
What is the best solution to make it possible?
Thank you.

One possible solution:
Point your MX records to google for your top level domain, domain.com.
Create support#domain.com email
Next, create a subdomain (i.e: sub.domain.com) and point the mx records to sendgrid.
Then, set up news#domain.com to forward to news#sub.domain.com. This way those emails get sent to your application.
Nothing needs to changed for sending outgoing transactional emails with SendGrid. You can send emails from news#domain.com. I also recommend to NOT USE noreply#domain.com, this hurts your deliverability(https://sendgrid.com/blog/why-you-should-not-use-noreplydomain-com-in-your-emails/)

The easiest solution is probably to use a subdomain for either the inbound emails or the outbound emails, so that you can keep the MX records separate. Receive emails to domain.com, send from e.g. mail.domain.com

Related

Sending emails with the same address via both SendGrid and Google Workspaces

I'd like to send emails programmatically via SendGrid (from admin#mydomain.example.com), but have replies to that email come to my Google Workspaces inbox for admin#mydomain.example.com). I would then like to reply to the customer from Google Workspaces.
The closest question related to this I could find is Setup | G Suite + Sendgrid for transactional email, but that was a fairly different use-case.
So in my usecase, emails to the customer would come from admin#mydomain.example.com via EITHER SendGrid or Google Workspaces.
Here's a article from MailGun that talks about a similiar pattern
My questions:
Will this result in deliverability issues, having emails sometimes come with different signing keys/domains? I don't understand email signing particularly well.
Is there anyway to have replies to the email address go to BOTH SendGrid and Google Workspaces, so I'll have it in my inbox but can also get it posted to a webhook by SendGrid? I think the answer is no, but figured I'd ask.
Any other considerations I should keep in mind for this strategy? Is this a poor idea for some reason?
Thanks!
Yes, this will result in deliverability issues. You should use the same domain for both sending and receiving.
No, you can't have replies go to both. You can have replies go to a webhook, but you can't have them go to both a webhook and a mailbox.
Final consideration: This is a poor idea. You should use the same domain for both sending and receiving. If you want to use SendGrid, you should use SendGrid for both sending and receiving. If you want to use Google Workspaces, you should use Google Workspaces for both sending and receiving. You can't use both at the same time.
Another consideration: If you're sending a lot of emails, you might get flagged as a spammer if you're sending from multiple domains.
The company I work for does something similar that might be helpful for your scenario.
We have a number of systems that send emails via SendGrid e.g. Auth0, Salesforce, various bespoke systems, etc. Some of these use native integrations to SendGrid, some use SMTP relaying, and others send emails programatically via the SendGrid API.
We've implemented sender auth (i.e. DKIM) in SendGrid for our domain e.g. mydomain.example.com, but we don't handle replies in SendGrid as we want replies to go to a different system - specifically our contact center system (which is the main systems our help desk staff use). Help desk staff would then reply to emails from within the contact center system. Note: we needed to configure DKIM for both SendGrid as well as the contact center system (as both currently send emails from mydomain.example.com), but in the future the intent was to implement a SMTP relay in the contact center system (to SendGrid) so that all sending goes through SendGrid.
I'm a bit fuzzy on the fine-grained implementation details of how we handle replies, but essentially we point the (single) MX record for mydomain.example.com to a third-party email protection system which scans the emails and forwards them to Office 365 mailboxes which subsequently forwards them to our contact centre system. I believe Office 365 is really only there for email posterity. AFAIK you should be able to point the MX record to anything that can handle SMTP.
In your scenario you should be able to configure the MX record for the mydomain.example.com domain to point at your Google Workspaces. This will allow you to send emails from SendGrid and use Google Workspaces to handle the sending and receiving of replies.
Not sure if you can configure SMTP relaying in Google Workspaces (i.e. to relay through SendGrid), but this would mean you'd only need to configure DKIM for SendGrid. All emails would be sent by SendGrid and replies would be go to Google Workspaces.

Send mass email with Gmail API

I want to send mass email with GMail API.
Currently I add all the addresses at the To section.
But every recipient should receive the mail and see only his address and not the other ones. Is there a method/API that I can use for this?
As far as I know, Gmail was not created for sending bulk emails as it restricts the number of recipients and has tons of other limitations. You should try to use third-party service for this.
Here you can find Gmail API limitation. It says
100 Recipients per message sent via SMTP (by POP or IMAP users) or the Gmail API

How can I forward specific emails to my server if I set my MX records to connect with Gmail Business?

I am using Gmail for business and have set the MX records for my domain to point to gmail.
I've been searching but can't find anything in regards to gmail api webhooks for posting specific emails to a specific URL route on my server.
I need to do something similar to this: https://sendgrid.com/blog/receive-inbound-email-meteorjs/ but instead of using sendgrid, I need to do it with gmail api since my MX records are pointing to Gmail.
Is this even possible with gmail api? If so can you point me in the right direction.
Basically any email sent to x#mydomain.com need to be posted to the route mydomain.com/incoming-email. Need to be able to do this with Gmail.

Receive (not forward) e-mail using Mailgun

I want to use Mailgun to send/receive messages programatically via API.
BUT I need to have also some mailboxes available using Thunderbird or other mail client.
For example I want to have user mailboxes at:
support#
sales#
admin#
And all other e-mails will be for API send/receive.
I can not forward my mail to GMail because I need to reply from the same address (sales#mydomain.com).
Please help.
There is a limitation to using the routing feature and that is that if you delegate a domain to be used by Mailgun you cannot use it with an email client.
That means that, for example, if you want to route emails to user#domain.com and then still use that email address with your favourite email client (be it Thunderbird, Outlook or Gmail) you can't do it. That is because of the way you've configured your MX records (email records in your DNS).
When you use Mailgun's routing functionality you delegate MX records to mailgun, which receives your emails, parses them and routes them according to your preferences.
So how do we solve your problem?
What you can do instead is set up your MX record on a subdomain.
Using subdomain.mydomain.com and pointing its MX records to mailgun will allow you to receive and parse emails through Mailgun.
This way you can have:
admin#subdomain.mydomain.com
sales#subdomain.mydomain.com
etc
will be handled by mailgun
while
admin#mydomain.com
sales#mydomain.com
will be handled normally with your email client.
Please do not hesitate in asking more details!
You need to configure your MX record settings for your subdomains in your DNS control panel.

How do I setup Mandrill MX records and keep my old email?

I setup MX records for my domain.
According to the tutorial, all other records should be removed.
I removed the old records and have since realized that I still want a regular e-mail account,
info#mydomain.com
How do I setup my MX records to handle this?
Mandrill's tutorial said that no other MX records are allowed.. I want to have info#mydomain route exist as well.
It's not possible to have a traditional inbox for a domain as well as have Mandrill accept email for that domain. Instead, you'll likely want to have Mandrill handle only a subdomain, like inbound.domain.com, and set up the routes for that subdomain. Your root domain could then be used for traditional inboxes for sending and receiving mail.
Alternately, you can set up your root domain to be handled by Mandrill. Whenever you get mail to info#yourdomain.com, you'd process the webhook POST, and use the information from that POST to create a new outbound message to some other inbox where you can receive mail.