Codeigniter emails not being received by gmail - php

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?

Related

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!

Prevent PHPMailer email going to Hotmail Junk Folder

I have created a mailing software using PHPmailer. Everything is working ok apart from emails are going to Hotmail junk folder. Yahoo, Gmail, Aol and other domains are receiving the emails but not Hotmail.
I have set SPF on my hosting for the domain which I am sending the email from and When I check the source of the email on Hotmail, it shows this:
Authentication-Results: hotmail.com; spf=pass.
The emails I am sending is not classified as spam as I get it checked with some online tools. I also tried sending test emails as if I am sending an email to a friend. Still no luck
Has anyona any idea if there is anything else I should do?
Note1:I have checked other posts on here but I couldnt find an answer so I am posting my own with my own details.
Note2: I have also tried sending Gmail SMTP and still emails are going to junk folder.
Note3: I have also tried the hosting company email domain to send but still it goes into junk mail.
Thanks in advance.
Take a good look at the email headers on the receiving hotmail account. There will be clues as to why you're email is being classified as junk.
Take a look at this article.
https://technet.microsoft.com/en-us/library/dn205071(v=exchg.150).aspx
You're looking for two header fields called
X-Forefront-Antispam-Report
X-Microsoft-Antispam
You're going to see a BCL, PCL, SRV with a colon after it and a value, depends on what those values are will be your clues as to why you're hitting the spam folder.
Without posting the full header, their's little information anyone is going provide other then telling you to try this and that. I'm a big proponent of telling people to use this mail tester, because it's the best around, but no mail testing program is going to solve every problem, but they are a good start.
Getting around email spam filters (as a legitimate sender) is a complicated issue.
Personally I recommend using Mailgun, Sparkpost, or another email service.
These guarantee delivery and most are free for the scale you'll be operating at. I personally recommend mailgun.

Using phpmailer to send to fake email addresses

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.

When setting up PHP mailer who should I set the From address as to avoid spam/blacklisting?

I'm using PHP mailer to as part of an enquiry form that I'm building for a client. One thing I've noticed in testing is that when I use my yahoo account as the FROM and my gmail as the to it works fine for a while but then it starts rejecting, I'm assuming because gmail is smart enough to know that the email isn't actually coming from Yahoo.
What is the best solution to this? I could use the email from the person who has actually filled in the form to show as the FROM address but I'm worried that this may eventually cause the same problem anyway? I could also send it from an email on the domain that its sending from but will that stop it from appearing as spam or black listing that email?
Any help or guidance would be great?
You are getting tagged as a spammer because you are sending the same message over and over. Set up your own mail server without a spam filter while developing if this is a problem.
You are not Yahoo -- don't pretend to be them! Set the From field to an address at the domain that's sending the mail (e.g, if your domain was example.com, send from something like inquiries#example.com or noreply#example.com).
This is probably related to SPF records. mail() will most likely try and send the mail directly to the server(s) identified by the MX record of the recipient domain, and because you are not sending from an IP address that is recognised as one of Yahoo's, Google will reject the email. If you are on *nix, you may be able to configure your system's sendmail program to relay via Yahoo. This is not an option on Windows (I don't think) because Windows has no sendmail and PHP will send the mail itself.
If you want a cross-platform solution you can use something like PEAR::Mail to relay the message through Yahoo's SMTP servers - this should resolve the problem as long as the SPF record is the source of the problem.
If your email is getting flagged as spam because of the content of the message, the only solution is to change the content of the message.

PHP mail() - Email not received

I have set up an AJAX contact form on a client's website.
The problem is that the email is not getting through to the client's inbox.
I set up the client with Google Apps (in the same way I did for myself).
I used the same contact form with my email address and it works. But with any email addresses on their domain it doesn't!
All members of the domain are receiving 'ordinary' emails.
What could be the difference that's stopping mail() emails getting through?
UPDATE
Ok so I managed to solve it. Turns out that using a CNAME to point the domain to the correct server wasn't enough for sendmail so I had to change it to an A record pointing directly to the server. Strange but true. Thanks for the help folks, you pointed me in the right direction :)
It depends on the both settings on your server and the server on the receiving end.
hotmail for example requires the use of correctly configured SPF records.
many mail-receiving servers (including hotmail) require the email to originate from a Fully Qualified Domain Name. It is very possible that your e-mails send from PHP do not comply with this rule. (there is a good chance they originate from 'apache')
see hotmail self help and hotmail postmaster info
PHP's mail() function does not include a lot of headers with your mail, so you will need to supply them yourself.
The more hops your mail makes on it's way to it destination, the more likely it is to be tagged as spam.
So it might be a better option not to use PHP's mail function and instead use a mail library that connects to an SMTP server just like your desktop mail application does.
All in all, I would place my bets on an external library: Pear::Mail (documentation)
You could also read: how do you make sure email you send programmatically is not automatically marked as spam
UPDATE
Failing the SenderId or SPF check can get your message dropped before it even hits the users inbox. The message will not end up in the users junk folder, it will go directly to /dev/null.
I know this is at least true for hotmail and live mail. I see no reason for other hosts not to have implemented the same policy.
I recommend using PHPMailer (including their SMTP) library instead. It is reliable compared to mail and allows you to create fully customized emails.
http://phpmailer.worxware.com/

Categories