I am using CI library for email.
$this->load->library('email');
And my mail function is.
$this->email->clear();
$this->email->set_mailtype("html");
$this->email->to($user_info[0]['email'] );
$this->email->from('admin#workerbee.com');
$this->email->subject($data['news_letter_info'][0]['subject']);
$this->email->message($data['news_letter_info'][0]['template_body']);
$this->email->send();
All values are coming correctly and mail is also delivering. But it is ended up in spam folder in gmail. Can anyone have any idea why this mail is counted as spam. What are the reason for a mail to be spam.
There are really many reason that might explain why an email ends up in the spam folder of your favorite mail client (web based or not) :
your server is in an ip blacklist
your emails contain keywords that are triggering a spam filter
you're sending spam
your mail server is misconfigured and sending out emails that look like spam
you are sending emails containing only images
your server doesn't use DKIM and SPF to authenticate email (see this webmaster SE question)
Many other reasons I don't remember ;-)
Jeff Atwood also wrote a nice article on his blog about good practices for send email through code.
As for some places to check if your email looks like a spam here are two I've found :
http://www.contactology.com/check_mqs.php
http://www.emailspamtest.com/
Related
This is a redundant question.
I am using phpmailer codeigniter library in sending email. I can send and recieve email however when I received it, it is marked as spam.
I think this info can be useful:
public $Mailer = 'mail';
public $Hostname = 'http://www.fhi365.com/';
public $Host = 'smtp.gmail.com';
public $Port = 465;
public $SMTPSecure = "ssl";
public $SMTPAuth = true;
What are the steps I need to do to solve this?
Thanks for help
This is not the issue of sending through server email servers.
For an email to be considered "safe" it has to meet A LOT of criteria, which, without full access to the server, I don't think can be configured.
First of all, you need to have DKIM and SPF key signatures that are actually valid. They are needed for the email service provider to be sure that you aren't a scam.
Next, you from email and domain (from email is what is before the #, and domain is what is after the #) have to be safe. Which means that when you send emails, people actually open your letter. Because let's say I set up a simple php email sending script and send some inappropriate pictures or some evil-evil programs. That is why ESP by default put your email into spam. That's why on most websites on registration, you are asked to check your spam folder. The website's domain does not have enough "positive" reputation to be considered trusted by the major ESP. If one person moves your letter from spam to inbox, you get a small reputation boost - but you need a lot of it.
Next, is the sender. The IP of the sender also has to be trusted. If you are sending from a PC IP that is known for spamming, even if you have all the previous criteria all set up, it will still be spam box for you all the time. That is called domain warming. You need reputation for your IP as well.
There are also minor things such as email content (if it looks like a casual letter, you have more chances of getting into inbox), the amount of styling and pictures you have in there.
Bottom line - don't bother a lot with getting your email to inbox. If the user KNOWS he is getting your letter in the email, he will get it out of the spam folder. Just notify the user about the email and you will be set.
I have used default mail() function to send email it sends emails to yahoo successfully but on gmail my emails are going to spam folder due a verification link, if I remove that link then goes to inbox
like is like this
domain.com/abnd.html?code=asdjkahsjkdhkasjghdksghdkjgsakjdg
if remove code then works, with code it goes to spam on gmail.
please help
Could be a number of factors:
Maybe the actual domain name or part of the URL is affecting the overall spam score
Is your email valid HTML and/or and have proper headers
Does the IP address sending mail have a valid PTR record
Are there additional headers being included in the email by the server that you may not want
There are a lot of good resources and helpful things you can use from the AOL Postmaster site including Technical Policy Requirements for Sending Mail to AOL.com, and the feedback loop.
Also see Google Bulk Sender Guidelines for more.
Im using PHP's mail() function to send some emails. But all my mails land automaticly in the trash box. Is there a way of preventing this? If so, where should i read to learn more about it.
Would you recommend me using PHPmailer?
Best of regards,
Alexander
TL;DR: There's no magic bullet. Just because you can learn how to form an email in PHP, does not guarantee it is routed to someone's mailbox, or even accepted. Success is based on reputation, not any single fix.
I am (edit: was) a mail server engineer, have written SpamAssassin rules, and have deep-dived issues for customers sending or receiving email.
The recipient's mail server scans your email, looking for attributes and "historical problems" (lack of mail agent, coming from your webserver IP, etc). These get "points". The total number of points is compared, and the recipient's server may do one or more of the following:
List item
refused during SMTP,
routed to Spam folder,
routed to Inbox, but tagged "SPAM"
blackholed (accepted, then mysteriously lost).
"Points" (score) only means something to a particular anti-spam solution. There is no public test. Fix ALL the problems you can, and success goes up.
*The #1 issue is: do not send email directly to the recipient's SMTP server. This network space sends 99.9% spam. It costs money to scan email, so a good email admin will block or refuse such connections.
The "fix" for your source IP is: Use an SMTP Gateway. The gateway can be our ISP mailserver, or a commercial service. Check first with their terms of service. They may prohibit sending emails using an authenticated web form, since these are so frequently abused ("someone hacked me" is not an excuse).
If you have email hosting, do the following: create a mailbox called for example 'website-notification#websitedomain.com'. Call it what you like. Now you want your PHP script to send the email -through- that address, using Authenticated SMTP. I'll leave the process of learning how to use Authenticated SMTP from PHP as a learning exercise for you -- there are many tutorials online).
Once you send emails through your valid SMTP server, the mail is seen as "originating" from your SMTP gateway. It's not seen as coming from your script. But this isn't the end of the story
As someone else noted, Be sure you are not missing display headers such as To: From: Subject: and Date:. Strictly speaking these headers are NOT "required" in email handshaking, but in practical terms no reputable email software omits them. Also, Date must be in the standard date format, or some spam filters will flag it.
This topic is not to be confused with "envelope headers" (the hidden stuff in the SMTP handshaking), which also can also impact your score. Using an SMTP Gateway usually takes care of this (since the recipient's mailserver will handshake with your gateway host).
Your FROM address must be VALID. Do not use a fake domain. Do not use your domain name with a fake mailbox name. Some anti-spam software will do a "Sender Verify" to test if the From address is bogus or fake (oversimplified: they'll try sending a reply and see if you would accept it or not).
The #1 mistake is setting your from address as "noreply#yourdomain.com", and not creating that mailbox. When that happens, everyone's "Sender Verify" on your email fails, and you look like a spammer covering their tracks.
If your domain DNS has an SPF record, be 100% sure it lists every IP that might send email for your domain. This is a technical topic. Having a valid, correct SPF record helps your deliverability a little bit. But if you misunderstand and create a bad (incorrect) SPF record, you will be worse off. Take your time to understand before using this.
If you have a business with a real address or PO box, don't use "Domain Registration Privacy" or "Domain Proxy" services if you can avoid it. When this was written (2011) It used to be very true that anonymizing services could get your mail blocked, or "tagged spam". This is less true today, but it's still worth considering.
Know the IP address of your mailserver, and regularly check that it is not "blacklisted" at SpamCop, SpamHaus, or the Barracuda spam blacklists. Google for more. There are monitoring services, and scripts which can alert you. But if you get on these lists, it means there is something else happening you were not monitoring for...
As said, no simple answer. :)
I suppose you mean thrash box at the receiver's end. So basically the receiving email server is regarding it as spam. This can happen if:
1) The IP you are sending from is already blacklisted for spamming (happens often in shared hosting)
2) The IP and domain are relatively new and unknown.
(Note that many times, newsletters from well established sites also end up in spam).
If its your dedicated IP, then setting RDNS for the IP, to match the domain name will very likely solve the issue. Another usual practice is to alert the receiver (if she is subscribing on your website) to check their thrash/spam folder and whitelist your email address in their mail account.
regards,
JP
JP's answer is partly correct but it also could be your header's in the email i know from experience this sends stuff to the spam folder try the following;
set the emails to your domain something like no-reply or a valid reply.
$to = 'nobody#example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster#example.com' . "\r\n" .
'Reply-To: webmaster#example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
This probably has something to do with your mail client and spam settings configuration. Try opening account on gmail.com and sending email there, if it's OK you know it is your mail server/client problem. If it's not, post your PHP code and full email headers of the email you've got.
This happens because many a times, headers are missing / if its a well known email server domain key signature is not present, or something like that. If you already have a separate email server, you should check out if you can use the PHP Pear Mail package to send email using your email server, rather than directly via mail function. That's what I find convenient, as its much more flexible.
I am making an application that allows users to send emails of complaint to a leader at my university. I would like them to as much as possible to appear they are coming from the users own email rather than from the website.
I'd use mailto links but I find a lot of people these days don't use outlook... most people use web mail :S
I guess the other option is to use the reply to field so at least the replies end up in the right inbox.
The send function allows you to specify additional headers - this includes From: and Reply-To.
However, you should make sure your mails are white-listed in the spam detection configuration, because anti-spam tools will (rightfully) mark your mails as spam.
You can't do this reliably: A faked sender address is among the #1 signs for spam and is likely to be filtered out.
The best you can do is specify a legit sender address on your server, and give the user's address in the reply-to header. In most mail clients, that address will show up as the sender.
As Pekka highlighted, you can set the from address but this is likely to get it specified as spam.
An alternative would be to send the email to the user with instructions for them to forward the mail to the University Leader, a bit roundabout but might do the trick.
i am trying to send email using PHP scripts... however, the recipient is receiving it in his/her SPAM folder -this is not the desired result (I would like to have it sent directly to their inbox so that I don't have to warn them to look in their SPAM folder).
below is the code I use to send the email using PEAR... what changes can I make to prevent the emails from going into the SPAM folder?
send("test.user#gmail.com", $headers, $body);
?>
In general, email is classified as spam or not spam on the receiving end, not the sending end - otherwise, spammers would simply say that all of their messages aren't spam, completely defeating the purpose. Thus, you can't just force a message to go to a sender's inbox.
However, what you may need to do is see if the machine that you're using to send mail is currently listed on any spam blocklists, and if so, take the necessary steps to remove it from those blocklists. The most common is probably Spamhaus.
How to increase the chance that the receiver doesn't mark an email as spam has been discussed quite some times here on SO. E.g.
How do you make sure email you send programmatically is not automatically marked as spam?
But there may be some tips specific to pear's Mail package on how to implement these steps (so I wouldn't consider this a duplicate ...yet).
You can purchase a dedicated IP address for your domain to patch this problem almost. After installing a dedicated static IP,all your email will have unique permanent sender ID...
GMail and other top mail services will list your email in Inbox...But yahoo and some other won't mind it....