Best way to send email to clients from e-commerce website? - php

I'm building e-commerce website that will sell all kind of items,
what is the best way to send emails to clients?
Our selling department will send a lot of emails to customers, emails like delivery, newsletters, coupons, and etc..
I don't want to use mail() function because the customers will receive emails to spam box, what is the right way to do it?
There is a companies like benchmarkemail, icontact, mailchimp, do i need to use them?

It's important that you understand the difference between "transactional" and "non-transactional" email.
Sending a order invoice, password-reset or welcome aboard email is transactional. It is send from you (your website) to one specific email address.
A news letter is usually non-transactional in that the same email is send to multiple people at the same time and many countries have strict laws about how these emails can be send and how people should be able to unsubscribe from them.
For transactional email I would suggest to use a third party service such as Mandrill or Postmark. They will make it easy for you to make sure that email arrives in your customers inbox.
For news letters I would suggest you use a third party service such as Campaign Monitor or Mailchimp. They allow you to set up sophisticated campaigns and see reports on how well your marketing email performs.

I would suggest using SendGrid and they also have PHP libraries. They have a free plan which you can try out. They also support creating email templates on your account which really simplifies the mails you send. All your mail formatting and related code is no longer in your application. I've used it and been quite satisfied so far.
Edit and disclaimer :-) I don't work for SendGrid, just had a good experience using it that is all.

It wont go to the spam box if you use mail(), you just need to make sure you send your emails from a registered domain. You should also sign each email and make sure the SPF records are set up.
Links:
http://www.emailquestions.com/help-desk/2418-why-do-my-own-emails-go-into-spam.html http://www.google.co.uk/search?sourceid=chrome&ie=UTF-8&q=spf+records http://www.techtalkpoint.com/articles/setting-up-spf-records-in-cpanel-whm-and-namecheap/

Related

Check Email's Bounce Rate ? like what neverbounce do?

I wrote PHP script that validates email with smtp check and mx record check.
its able to give weither email is valid or not but
i want to add functionality of explaining bounce rate of email.
I see similar platform like neverbounce doing this.
Do i need any kind of AW service? or any kind of special hosting to check bulk emails are spam/bounce or not.
Please Advice
Thanks.
Bounces are not about content, but about quality of subscriptions in yours list. Services like mailcheck.co, neverbounce etc will help to avoid non existing mails, hard bounces.
For validating email content and MTA settings you may try mail-tester.com
It will suggest to change email content if it looks suspicious, and will ask for proper mail transfer agent settings, like DKIM, SPF etc.
But in common - it's two different tasks. First one validates your email list, second one validates sender and email.

How to preview an HTML email in various email clients before sending it. PHP/Javascript

I have developed a web app which is sending HTML email using PHP. I would like to let the user be able to see what the email will look like in various email clients (Outlook/Gmail etc) before sending it out.
I searched, but I could not find any plugins that would let me do this.
I found the Litmus email preview API which would work, but it is too expensive. Is there any website that has a similar API for a cheaper price or free that I can use? Or is there any way I can do this myself without the need of some other website.
To send bulk emails to clients, I use "poMMo" (https://github.com/soonick/poMMo), it allows you to view the email and even receive an email test, before sending it to the clients.

Specify the "send via"- or "on behalf of"-value in Mandrill

I'm using Mandrill to send E-Mails in my PHP Project and integrated it via the API. So far so good E-Mails go out and arrive their recipient, but something bothers me about the missing SPF and DKIM entries.
When the E-Mails are opened in outlook the "on behalf of" issue occurs (FAQ from mandrills KB). But I can't fix this, since too many of our customers do not have the necessary skills/ access-rights to create a SPF entry for their domain, so we learned to live with that.
We verified our own domain at mandrill to use it as custom sending-domain to get rid of the
from: reallyLongString#mandrillapp.com on behalf of customerName#customerDomain.com
and exchange it with
from: mailbot#ourDomain.com on behalf of customerName#customerDomain.com
but somehow I can't get this to work!
I cannot find an option to set "mailbot" as sender. Even worse, Mandrill makes up a phantasy e-mail-address consisting of customerName#ourDomain.com. If some customer gets the idea to send to this address we've got a disaster upcoming. Also the API does not specify anything like that in the "Messages"-Section.
How can I configure mandrill to send E-Mails with a from-field appearing in outlook like this:
mailbot#ourDomain.com on behalf of customerName#customerDomain.com
? Really cannot find anything in the docs or the web. Thanks in advance!
As Sanuel Jackson already indicated, there is no way to do this WITHOUT doing the whole certification process of creating a SPF entry.
Also confirmed by Mandrill support (which was quite fast AND competent in responding)
I'm now sending with a proper reply-to address and hope, that our customer's customers ignore the funky e-mail adresses... In case they do mind them, our customers are free to engage us regarding a SPF-entry ;-)

dynamic from address - postmark

I'm using Postmark to send emails. I want to be able to use if for a send to a friend form so I need the from email address to appear to be from a specific sender. It looks like Postmark only allows you to send from the address specified in the signature. Is that correct?
Alex here from the Postmark team. We can enable dynamic sender signatures in your account for approved usage. Drop our support staff a note, support#postmarkapp.com, and we can enable that feature for you.
The reason for this restriction is to help reduce the likelihood of spam complaints, part of our system that we carefully manage to keep deliverability high for everyone. In your particular use case, depending on how you design your feature, it is possible that someone could start using your form to send spam.
Additionally, by not having a specific sender signature, your emails fall back to our email signing instead of your own - this may impact your delivery rates. For optimal delivery, we recommend having the "from" be a real email address that the account owner can access, and use your users' name as the "name" attribute and their email in the reply-to.
That's not always possible, though, so we can manually enable the dynamic from address feature on request. Just know that delivery rates may be impacted and if the form begins generating significant spam complaints, we may contact you to request that you make changes to your system.

Dynamic Mail Forwarding Based on Superscription Table

Client asked this morning if we can provide a subscription service whereby:
Mail arives to a specific address on a cloud mail server with no procmail/maildrop possibilities
Cron runs Perl or PHP script on another server which checks for new mail and based on address mail purports to be from, does a subscriber look up, and forwards the email with any attachments to all subscribers along with an added unsubscribe link
Script deletes forwarded email
Mail server will have both IMAP and POP access, apparently.
// EDIT
Note that mail will be from 220+ governmental agencies/organizations. Users will use interface to specify which organizations they wish to receive forwards from. In order to run like a traditional mailing list we'd have to set up 200 mailing lists and then make an interface to handle subscriptions. The proposed interface will allow 1 - 200 subscriptions with a single opt-in confirmation email and a single opt-out interface.
// END EDIT
Client has been warned that header spoofing is child's play and that viral attachments are a serious concern and is willing to proceed nonetheless.
So, with the caveat that this is NOT an idea that I endorse what libraries have you used to accomplish this sort of task?
You do not mention what kind of mail server you are dealing with. Perl has Net::IMAP::Client and Net::POP3 to handle fetching mail.
For sending email using an SMTP server, there is Email::Sender or Net::SMTP or Net::SMTP::SSL.
At a minimum, you'll need an email account which you can use to send emails (this might be the original account that receives the messages).
In between fetching and sending, you can check for spam using Spam Assassin and for viruses using ClamAV.
I don't know why the original messages need to be deleted, but at the very least, I would log every single step in detail.
What you're describing is a mailing list. If at all possible, you should look into using one of the several existing software packages designed for managing such lists, such as majordomo, ezmlm or mailman, rather than trying to roll your own.

Categories