Using phpmailer to send to fake email addresses - php

I am working on a bulk email class for a project and am using Amazon's SES smtp via phpmailer. I am trying to figure out a way to test sending multiple emails without getting blacklisted, spam blocked or blocked by the host. I would ideally like to test anywhere from 10,000 to 40,000 separate sendings. Ideally I would send test submissions to dummy addresses.
I know there are services such as http://tempinbox.com/
or
http://www.fakeinbox.com/
But what I would like is a reliable trusted service for testing bulk mailings without using my own personal email addresses.
Does anyone have any experience with this? If so, could you please point me in the right direction. Or let me know if this questions is better posted elsewhere. Thanks in advance.
Regards

If it was me I would setup a new domain (or use an existing one), and setup a catch-all account. That way you can send emails to test1#mydomain.com, test2#mydomain.com, test3#mydomain.com etc and you don't have to actually setup all those email accounts.
I actually do this with one of the domains I own, but more in the order of 200-300 separate accounts, not 40000.
All the emails will be directed into a single mailbox using this method.
Most likely, you are going to have to throttle the outgoing pace to 5/second if I remember correctly for AWS-SES (or AWS will do it for you and not gracefully).

Use a gmail address and the plus (+) sign after your email address with an extra identifier. For example, if your gmail account is
spamtester#gmail.com
send your test emails to
spamtester+1#gmail.com
spamtester+2#gmail.com
spamtester+3#gmail.com
...etc
They'll probably all end up in your spam folder, but you can whitelist them or just look in Spam to see them.
Brian
Reference: http://gmailblog.blogspot.com/2008/03/2-hidden-ways-to-get-more-from-your.html

I am sure there are many of companies providing such services. The principle is, that your mail queue is going to the service company's main server, from where it is then distributed across many mail servers that company has in their cloud and from there it is being physically sent. That ensures your emails are delivered and servers that sent them are not blacklisted, because of the distribution. Unfortunately I do not have links, but sure uncle google will have some answers. Hope this helps a bit. Cheers.

Related

Sending email from a web server if it's hosted on another server

I am in the process of having a web app built. And it will link into other people's websites.
It's purpose is to be a login to a portal which will manage their customers and data.
My app will at some point send an email to their customers acting upon the clients interest.
My concern is that we won't be hosting our clients emails.
So my question is can I get my web server web app to email the customers of my clients using their email domain name?
I think all I would need is the mail server and email account details.
I think I'll be using phpemailer unless anyone can recommend anything else? Is it even possible?
I'm just looking for answers or documentation ton help me setup configure if anyone knows of any.
Thanks in advance
As Barmar says, if your clients include your servers address in their spf records (and only use SPF for protection) then your mail server can send messages with a from address with the clients domain.
However, there another schemes, DKIM, which requires a private key issued by the client. To confuse things further, there is a scheme combining DKIM and SPF called DMARC.
Multiplexing the schemes and client keys via your own MTA is a formidably complex task. While #Barmar usually gives good advice, in this case I think a recommendation to simply ask the clients to include your domain in their SPF is not the best approach.
There are a lot of different choices:
a link back to the clients MTA (for clients whom operate their own MX) which would need to support SMTPS and SMTP authentication. Possibly even vpn support
the spf based model (for those not using DMARC or DKIM)
sending emails from your MTA but with a a masqueraded text part in the email address, e.g.
From: "a_user#yourclient.com" <a_user_yourclient#yourdomain.com>
...but with a Reply-to header pointing to the clients address, although this may impact your IPR
just use the clients email as the from address for those without any protection scheme
It would be straightforward to handle the initial routing of the email within your applications code, but you are going to need developers who really understand how email works in practice.
I would recommend you to use mailgun... Mailgun is simple to implement, you can send 10000 emails for free every month (see below) and you can send emails in behalf of clients domains. You need to add new domains to mailgun account and verify them like it's described in the documentation (see below).
Official SDK for php
https://github.com/mailgun/mailgun-php
Domain verification documentation https://documentation.mailgun.com/en/latest/quickstart-sending.html#verify-your-domain
Pricing plan if you need to send more than 10k per month..
https://www.mailgun.com/pricing
Here are some options:
If your client provides you with an account in their email environment, then you can send using those credentials. Assuming your client has a properly configured mail environment (SPF and/or DKIM and/or DMARC), then everything should be good.
You can send from your email server directly, but your client's SPF records should include your server's IP address(es) if you don't want the email to go to spam. (Though it's possible the email will not go to spam depending on a lot of voodoo related to spam filtering and IP reputation)
You could have your client setup a DKIM DNS entry with a public key that you generate. Then you could have your server sign the message using DKIM and send it on behalf of the client.

Mails not sending to outlook, hotmail

I have my site hosted on bluehost which sends out daily mails to customers (with cron jobs). All mails are working fine except outlook and hotmail. Customers are not getting emails on their outlook/hotmail accounts. I checked the code and it working properly, returning true with php mail function.
MX records on hosting are set to gmail, bluehost supports says its a code issue or I need to consult with google but when I send direct mail through gmail account customers are getting them.
I am not sure how to debug and resolve this issue. Can someone suggest me the ways to resolve this or the possible reason behind this.
I know this is a few months later, but maybe I can help. I fought with this for a while. It depends on the mailer you're using, and your code a bit so it would be best to post it here.
Overall though, outlook and hotmail have extremely high spam filters, so there's a list of things you need to consider.
First - I've heard third party mailers will get blacklisted or blocked pretty quickly (check their reviews), so check that the IP address hasn't been blacklisted. You can contact outlook to do this (good luck), or send yourself an e-mail, find your ip in the header of your e-mail, and check a blacklist checker online somewhere.
Second - As part of USA's CAN-SPAM Act of 2003, you need to provide some sort of unsubscribe link as well to be in the good books.
Third - If you are using phpMailer or something along those lines, you'll need to remove anything that looks like this:
$mail->AddReplyTo("youremail#domain.com");
$mail->From = "youremail# domain.com";
Because that will get it marked as spam.
Fourth - If you end up trying to send your e-mails through your gmail instead, allow access to third party apps, then go here (https://accounts.google.com/b/0/DisplayUnlockCaptcha), it will show up in your hotmail just fine.
Be warned that if you test your hotmail too often with the same message, it'll get blocked again.
Hopefully this helps!

Codeigniter emails not being received by gmail

I have an app where i'm sending emails on certain events, but when i used my gmail account, i never receive the emails and they are not in my spam folder. When i send them to my work email, i receive them instantaneously.
What do i need to do to get the emails through to google?
I'm using the standard codeigniter email configs (which i think uses sendmail).
I'm using google apps for business and i have the MX records setup that google provides.
Do i need anything else? Also, i'm using subdomains in my app, does that affect what i may need to setup?
EDIT
When i use smtp like this example Sending email with gmail smtp with codeigniter email library, the page never seems to come back. It eventually just timesout.
The only plausible explanation for this behaviour is a SPF Check failure. SPF or Sender Policy Framework is a new technology that allows easy detection of spam. Gmail honours SPF unless you manually mark those emails as not spam. Regardless of this, if you have received emails on another address then they must have reached Gmail too. Check your spam thoroughly, as Gmail does not discard emails even on very high spam suspicion rather they end up in the Spam folder.
You can set up a SPF that allows your webserver to send emails which will result in Gmail accepting emails sent by your webserver as authentic. See http://www.mydigitallife.info/how-to-set-up-and-create-sender-policy-framework-spf-domain-dns-txt-record-with-wizard/ and a wizard from Microsoft.
You will probably see, that at some point in the future, you'll get them all appearing in Gmail. Google is most likely seeing if the sender is spam, and holding those messages. I've experienced that before setting up dev servers. I would suggest using a transactional email service, like Mandrill or SendGrid. You'll find you get a lot of info from those services that you forgo if you simply send an email through PHP.
The Filter Theory The other possibility is that the poster has a filter set up on their GMail account that is filtering out the emails.
I would make sure that you are sending the required header information as well. Have you tried registering a new gmail account and sending it to that user?

Bulk mailing/mass mailing from Server

i need to send bulk mail in my php application, but its outgoing limit was 500, if i purchase VPS server for sending email if it grows more than 1000+ gmail /hotmail will mark me as a spam , so what is the solution for this issue?
{ purchasing api from mass providers is not under my budget }
If you think your mail is not spam and your mail server is not setup as a relay to others, then it is ok to go with a VPS server for the purpose.
In my case, I keep sending alerts to my customers on different conditions. The emails may amount to about 10000 a day. But I hear that these are blocked only in rare occasions and we ask the customers to add our from email to their address books and it becomes good after that.
If your mail is not SPAM then you should be be able to deliver it, with some effort. Read for example Gmail Bulk Senders Guidelines.
One consideration is that you should not start with sending thousands of mails to gmail or any other mail provider. If their system does not know your server (specifically the IP address of your SMTP server), then it will block you. Start sending a few mails per day, and gradually increase the count.
I think VPS is only usable if you get your own dedicated IP address. Otherwise I would rent a dedicated server.
I can suggest you an idea,which might sound WIERD !!!! and might lead you to pull hairs.
Search for peter bromberg article in egghead cafe on Asynchronous Mail sending technique. Search on google if you can send messages from multiple account via single app. For example if your target for the day is 10000 mails, and per day limit for any common email id (or free version or lite version of any bulk mailing) is say 500 then create an array of your email and assign them mail sending responsibility as per their limits. try to achieve this via your programming skills.
This is the only way i can suggest you in a very cost effective manner. But again you need minimum of 10-15 email ids for it, which is a biggest drawback of these approach.And you might need to create more 10-15 emails, if the earlier ones get blocked by your Service Provider or receivers SP.

Create a random disposable mail receiver

I need to create random e-mail addresses that possess the role of receivers. Though these addresses should not be in any case real e-mails. I know that this kind of problem could easily be solved by creating something like Random_root#dummy_host.com . But the real deal is that there's a case my CMS will notify via e-mail these accounts, and so in this case the server will have a re-bounce mail traffic or even worse the host could be black-listed as spam.
I am thinking a mail server that dispose any kind of non existed mail address at its host but I can't find any applicable.
Thanks in advance!
Though not a PHP solution there is a web based service that runs off an API you can use, take a look at http://mailgun.net/
Again not a direct PHP solution but http://cloudmailin.com will allow you to send to any email address at your domain, you can then use a 403 status in your app to reject email to anything you're not expecting and the mail server will actually refuse the message.

Categories