Sending emails–not as easy as you think
I am just doing the last few lines of code for my new site (To be released very soon), part of every site is the ability to send emails to your customers.
I will start with 1 important line – “The communication with your customers is the key for success and as such you need to ensure that you have the right infrastructure”
You might want to use your native SMTP on your ISP/Host, and have write fancy code that will manage delivery, OOO operations, Unsubscribe, Report on delivery, track clicks, bounces and the list can continue
But before you do that remember the first syntax and understand that to write such infrastructure you need deep understanding and tons of line of code and time, which no one has.
Another alternative is to integrate into online infrastructure (using SMTP, Rest api, etc) and get all the above features for small price between 10$ – 80$ for small business depend on usages.
I decided to use SendGrid because it was free for my usages, but there are other companies like MailChimp, etc
While writing the small piece of code that just send the messages using SendGrid SMTP, I face few road blocks:
- My email went to the SPAM folder
- When I finally got the email it was badly formatted without style sheet
You really need to read some articles that talk about how NOT to go to the SPAM folder before you write emails and as for the styling I found out that there are many constrains for HTML in emails
Luckily there is a good site called PreMailer that enables you to convert HTML page or text into a well formed email with inline stylesheet as needed and it will also alert you on risky in your current stylesheet
After all the above the key was to TEST-TEST-And TEST again, which is pretty weird when you think about it, since you see the output but you can never know what will happen