SMTP use clarification - email

need some high level direction.
I'm building a website. I'd like to be able to send emails for various situations.
when user registers, send confirmation email
if an error occurs, send me an error email
when users join a message string and a new post occurs, send all users on the string an email
send mass email for weekly updates
Can I use a free SMTP server such as Gmail?
If so, what is the diff between using Gmail vs a paid service such as SendGrid?
Will using gmail SMTP be sufficient for my purposes?
Thanks for any clarifications ...

I work at SendGrid.
SendGrid provides a few things out of the box that take a bit of extra work via gmail. You get analytics for things like opens and link clicks, as well as device and browser stats for those events. We provide whitelabeling that will help you configure the SPF, DKIM and DMARC records for your domain so you can send from your own domain rather than from gmail.com and be sure that receiving servers will trust the message. Also there's unsubscribe management.
gmail has some limits as well, described here. SendGrid lets you send 12,000 emails a month with no daily cap on the free account. So if you think you might eventually outgrow gmail, there's no reason not to start with SendGrid now.
Additionally, if you plan to interact programmatically with your email, there are a number of officially supported Sendgrid libraries that make integrating easy. When you integrate with the API or our custom SMTP-based API header, you can use templates, perform A/B tests, and assign unique arguments and categories to your emails and take advantage of lots of the things that let you decouple your content from your code.
Let me know if you have any additional questions.

The main reason why people go for services such as SendGrid is because of how hectic it can be to rightly configure your SMTP settings. I would say try going with SMTP, if native GMAIL fails, try doing it via Outlook(download the GMAIL Outlook plugin). If you can't, then go for SendGrid, which is very easy to use. Hope this helps :)

You can do this with an SMTP server like Gmail.
In your situation you could set up a process to send email messages when an event occurs, something like this (in Python):
import smtplib
import time
MYEMAIL = "enter your email"
def GetSecurePassword(): ...
def CheckNewUsersRegistered():
...
return emails_messages_list
def NewErrorOccurred():
...
return MYEMAILs_messages_list
def NewMessagePostedByAUser():
...
return emails_messages_list
def NewWeeklyMessageReadyForAUser():
...
return emails_messages_list
def Login():
server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
server.login(MYEMAIL, GetSecurePassword())
return server
def SendEmailsMessages(emails_messages_list,server):
for email,message in emails_messages_list:
server.sendmail(MYEMAIL, email, message)
def run():
while True:
time.sleep(600)
server=Login()
SendEmailsMessages(CheckNewUsersRegistered(),server)
SendEmailsMessages(NewErrorOccurred(),server)
...
server.quit()
if __name__ == "__main__":
run()
If you have a free Gmail account, you can send between 100/day to 500/day messages per day (depending on how you are logged in). You could also pay Google $10/month for GSuite which would give you up to 2000/day.
The problem with the homegrown approach is you have to reinvent redundancy and fail safe modes - what happens when your process chokes? How do you migrate your process to a new server or add extra users? With a paid service like Sendgrid, they will have solved these problems. I suppose it comes down to the price/value ratio of what Sendgrid offers, vs what you need and how easy is it for you to do it in-house. If getting really good at automating mail is not your business's core competency/differentiator then it's likely Sendgrid will be better value for money.
EDIT: Just remember though, the code summarized by ellipses is the code you will have to write anyway whichever way you go.

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.

Is SMTP plugin important for WordPress?

I have a website based on WordPress.
Every page has his own Contact form.
I am using Configure SMTP
+ Contact7
(SMTP is setup to user Gmail as a SMTP server).
After a while I'm curious why I am actually doing it this way.
Is Gmail that secure or it is only about SSL?
Is WP build in mail function secure (and good) enough to use it?
In total: what is the best way to make contact form in WordPress and avoiding my mails getting to the spam folder?
I was told that the solution descriped above (Gmail SMTP) is the best way, is it?
Well, the build-in mail function works fine for most uses, like sending "Password lost" or "New user registered" mails or even contact forms.
If you send more than just a few (can´t name a number) mails via contact forms, newsletters etc. you will probably want to use a mailserver for that, either an external one (GMail) or a properly configured internal one. They go much easier past spam protection because they are known for sending mails and are probably whitelisted at the big mail providers. Your webhost most probably is not and might be considered as spam very fast when he is sending mails regularly.
If you want to send a lot of mails in a short span of time you should probably go one step further and choose a service like Mailchimp or something similar for that. Their business is sending newsletters and so nobody (means the mail providers) wonders, when they have lots of mails incoming from one of those servers.
For your use case I would stick to SMTP via GMail, when it works fine for you. As you are not sending lots of mails in a short span of time you´ll have only little problems with getting rated as spam and you also have a trusted server sending those mails. Seems fine for me.

Email Server to only handle inbound messaging and routing

Was hoping for some ideas as to a service to which I can set up an inbound-only email system. In other words, I will have multiple users on the system, each can receive their own email... but at the moment... at this time, I am not focused on the ability to send or reply to messages, only receive them and send to the appropriate user. I looked into Postmark... They seem to have some great functionality.
CloudMailin Is another alternative. However there are effectively three options for setting up something like this.
Use an existing, traditional, email server and poll for the emails
Setup your own email server and create a script to run when you receive an email
Use a third party solution, as you've already mentioned.
I went through for of these for Rails a little while back here, but all the information is still relevant.

Sending single emails without being marked as spam

I'm using my Google Apps account (Standard version) to send single emails (automatically) to real interested customers.
The problem is that my sender email account has been suspended, because it's been considered as a "spammer" by Google.
What can I do in order to send that kind of emails from now on? I use MailChimp to send massive emails, and I've seen it has an API, called STS, for sending single emails, but it also required an Amazon SES account, so I don't know whether to invest on those services or doing something else.
What do you recommend for this case?
You should try a service that specializes in sending "transactional" emails, such as Sendgrid, Postmarkapp and Mailjet.
They have APIs and libraries for most programming languages, but in your case you just need to configure the SMTP server they rovide in your email client and you're good to go. They help you not get into the spam folder of your recipients, and help make sure you don't get flagged as a spammer
With most of them you should get some prettty powerfull analytics as well, which is a nice bonus.

How can I test an email-sending script that will send out to over 1,000 users?

I have a PHP web app that is going to send out about 1,000 emails. I would love to test the performance beforehand. Is there any kind of service that provides dummy email addresses to send to, for this kind of testing? I can't find anything that's not just a general bulk-email service. The key here is I just want dummy addresses to send to.
If you have the ability to just purchase a domain name from a hosting service, I know at least 1&1 gives you like 2500 email addresses per domain so you could literally spam yourself to death and not worry about any other 3rd party. You can pick up a domain name for like
When you say "test the performance", do you mean you want to know about your deliverability rates, or how your emails look?
Deliverability Rates
This is entirely dependent on your SMTP server and the reputation of the IP that it will be sending from along with your domain's SPF records and the content of your email. To maximize this, I would recommend using a marketing email service such as MailChimp or MadMimi.
Appearance of Emails
You could always just send yourself a test email to see how it looks. An alternative is to use a service like PostageApp that has a built in template designer that has both an easy email preview function and a test send email function.
(Full Disclosure: I am the Product Manager of PostageApp.)
If you use "Post Hoc" you can send email to an unlimited number of email addresses. Post Hoc acts like an SMTP server, and receives the email messages that you are sending, but it does not forward them on anywhere. You do not need to set up any email inboxes ahead of time, so there is no problem if you have 1000 different unique email addresses. They do not need to be from a single domain -- you can use any email address you want. It stores the email messages received so that you can inspect them if necessary. You would run it locally so that there is no concern about network problems, and it is very low overhead since it does almost no processing of the email. This way, the performance measure will be mostly the sending side processing. Best of all, it is open source and freely available:
Find it on GitHub: GitHub for Post Hoc
Also see the blog post: PostHoc: Testing Apps that Send Email