It’s been a long time that i didn’t write an article due to a lot of challenges in my career, and then i decided to add new resolution 2019 to my list and is to write continuously here and share my experience in email marketing with my peeps.
First of all, Let me introduce myself to the new readers of REKBLOG.COM, My name is Reda El Kasraoui and I’m the only guy here is in this humble emailing blog.
Today, I Will show you how to integrate Sendgrid SMTP with PowerMTA the easy way, while i am explaining this for you guys make sure you have an activated account with Sendgrid
Let me make things faster and easy for you guys:
First of all, you will need to activate your API KEY in your Sendgrid account
Preparing Sendgrid API to Implement it with PowerMTA:
Creating an API key
- Go to the API Keys page in the SendGrid UI, and click Create API Key.
- Give your API key a name.
- Select Full Access, Restricted Access, or Billing Access.
- If you’re selecting Restricted Access, or Billing Access, select the specific permissions to give each category. For more information, see API key permissions.
- Click Create and View.
- Copy your API Key somewhere safe. For security reasons, do not put it directly in your code, or commit it somewhere like GitHub.
NOTE: Be Careful, you need to save the API key somewhere safe
as you will not be able to retrieve or restore it.
Setup New PowerMTA Directives With Sendgrid:
Let’s say for example:
your Sendgrid Username is: “rekblog”, and your API Key is “YOUR_API_KEY_HERE”, Let’s say your VirtualMTA in your PowerMTA Config file is something goes like this:
<virtual-mta YOUR_VMTA_NAME>
smtp-source-ip 1.2.3.4
host-name rekblog.com
</virtual-mta>
We will add a new tag called <domain> that ends with </domain> which is similar to HTML, and it should look like the following:
<virtual-mta -YOUR_VMTA_NAME>
<domain *>
auth-username rekblog
auth-password YOUR_API_KEY_HERE
route smtp.sendgrid.net:25
use-starttls yes
max-smtp-out 1000
</domain>
smtp-source-ip 1.2.3.4
host-name rekblog.com
</virtual-mta>
Therefore we used Sendgrid With Powermta Directives starting with “SMTP Host” which is “smtp.sendgrid.net” and Port 25 (587, & 2525 are also allowed for unencrypted and TLS connections), Your Sendgrid Username is actually the SMTP Username and the API_Key is actually is the password
Also, we started the <domain> Tag with a star (*) to apply this configuration to all email domains, but if you want to apply only on gmail.com, aol.com, yahoo.com …etc, All you have to do is to change the star (*) with the domain macro you desire.
Most noteworthy , Here’s another answer for a question many of you will ask : “is it possible that my IP address in the same Virtual MTA get burned or blacklisted?” the answer is: “Definitely No! The IP address is like a user that access that SMTP for you
Let me know if you have any questions guys.
If you like what you see don’t forget to share this with your friends.
Happy new year everyone.
3tiw Cha7t 😉
Email Developer, SEO Specialist and Full Stack Web Developer
Tetouan, Tetouan/Tangier, 93000, Morocco
younes
good work bro