This question already has answers here:
How do you make sure email you send programmatically is not automatically marked as spam?
(24 answers)
Closed 7 years ago.
I attached an auto email sender with the file name sendemail.inc.php to be sending auto welcome once registered but it lands on spam. Is there any advise that can help?
It would be easier for us to understand why your email goes to spam, if you could attach your code with your question.
There could be several reasons your email can land at spam at the receiver's end.
Check whether your server's IP is blacklisted. Email from a blacklisted IP address will reach the spam folder.
Check whether your domain's MX record is fine.
Check whether your reverse MX A Records (PTR) points to your hostname or IP address
Check if your email content contains too much hyperlinks
Check if your email content contains abusive, marketing words
Check if your email content contains spam trigger words (e.g. Congratulations, won, $)
Try keeping your email in text format, rather than HTML format. It helps your email score. Otherwise include a text version of your email if you are sending HTML emails
Maintain a good text-to-image ratio
Avoid large attachments. If you really need to send large attachments, use something like Dropbox, Google Drive etc to send your file as a link.
Check if your email headers are properly set. If not, use something like PhpMailer. It is a free PHP script, and does it's job pretty good.
Hope this helps.
Use transitional doctype in html emailer.
we define doctype for html while create page. the html emailer needs the same
e.g.
Related
This question already has answers here:
How do you make sure email you send programmatically is not automatically marked as spam?
(24 answers)
Closed 5 years ago.
I am trying to send a google login link in email body, but it always marks as spam.
The reason which i've found only is accounts.google.com, even though the 'google.com' also not. When i put account. in start of this; it goes to spam otherwise everything works perfect.
See the link and email body below.
$google_link='accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri='.$site_url.'&client_id='.$client_id.'&scope=email+profile&access_type=online&approval_prompt=auto';
$html.='<div>
Click here
</div>
';
wp_mail( $email_address,subject, $html, $headers);
Question: Is there any way to encrypt this URL in email body to send and it works proper in email/gmail inbox?
Is there any other way to avoid the email going to spam like marking specific email by it's subject using any third party mail sending tool?
You can use the third party service SendGrid by registering and installing their WordPress plugin. SendGrid process your email text and replace links with links to SendGrid such that the accounts.google.com will not appear in the email. Upon a user clicking the link, SendGrid will record the click and redirect to your original URL.
Alternatively you could create your own redirect URL. The most secure method would be to have a table to store the URLs and generate a unique token such that you could put your own link in the emails along with the token. When your script is hit, pull the target URL from the table that matches the token and redirect to it.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How to check if an email address exists without sending an email?
Possible duplicate:
How to check if an email exists without sending an email?
I have a very big database with users (over 50000) and there are lots of automated e-mails the site sends out.
The problem is, quite a few of the addresses in the database (that users registered with years ago) have expired or have been deleted or no longer exist for whatever reason.
This creates an issue, because each user should have a valid e-mail.
I've been trying to find out if there's a way to detect whether an e-mail address is active, so we could update the database and prompt those users to enter a new e-mail? Something like a ping for e-mail addresses?
There's some code here that I've tried to figure out but to no avail:
http://www.webdigi.co.uk/blog/2009/how-to-check-if-an-email-address-exists-without-sending-an-email/smtpvalidateclassphp/
Does anyone have a solution?
Please note that I need a PHP solution, not command line since I have 50k e-mails to check.
Two things, first you should stop the influx of potentially in-valid email addresses by implementing a 'closed-loop' email verification system. Basically, when a user signs up for your site, you send an email with a link confirming their email address, and when they confirm, their account gets full access to your site.
Secondly, there is no real way to determine if an an email address is invalid strictly using PHP. I had to tackle this problem a few months ago, and we ended up using the mail-server to tell us if an email address has been bounced back or not. When your mail server sends an email, and the email cannot be delivered, the recipient mail-server will respond with a bounce notification to your mail-server which includes information as to why the email was bounced. Information such as a Delivery Status Notification (DSN) code which identifies why the email address couldn't be delivered.
Some example codes:
511: Bad Mailbox
512: Bad System
516: Mailbox Moved
These codes are made up of a prefix (4 or 5) to indicate a transient (temporary) or permanent failure. The following two digit code indicates an error range; two digit codes between 10 and 19 indicate an error relating to the email address, whereas codes between 20 and 29 indicate an error relating to the email mailbox.
From these codes you can determine, based on business requirements, a 'hard bounce' or a 'soft bounce'. A hard bounce would be something like 511 (bad mailbox), where it's certain that this email address is not currently valid. A soft bounce would be something like 445 (network congested), which indicates that it was a temporary issue as to why the email could not be delivered.
So in your instance, you could send out an email blast, and then track the bounces on your mail server. By looking at each bounce and the respective DSN code, you can flag whether an account's email is valid or not (we used PHP to gain access to the mail server and parse the bounce notifications for the DSN codes)
Here is more information on DSN codes.
-- Edit --
As Dagon wisely mentioned, you can pipe bounced emails into a PHP script upon their receipt. To do this you will need to read up on your mailserver config, but ours looks similar to the following:
bouncehandler unix - n n - - pipe
user=nobody argv=/usr/bin/php /path/to/BounceHandler.php
<% end %>
The only way to check if an e-mail address is expired or not is to send an e-mail message to it and see if you get a response. But note that doing so may be considered spamming, since it is an unsolicited message.
You can check if an e-mail address if properly formed, and if the mail server it specifies actually exists, but thats about it. There is no way that I know of to check if the account exists (and if a human is reading the mail sent there) without sending a mail with a link and requesting that the user click the link.
this was ask over and over and still no good solution!
When someone sends an email using php and placing another domain in "from" it will end up in spam.
Solutions normally are:
- Use your "from" and place the domain you want in the "reply-to";
- Have your domain whitelisted by main mail services.
The 1st its not really a solution and I was never able to make 2nd, because its impossible to reach hotmail.com, yahoo.com, etc..
I see lots of sites today having the option to email article to someone from the user email. How can I achieve this?
Thx,
Telmo Cardoso
When someone sends an email using php
and placing another domain in "from"
it will end up in spam.
This is not neccessarily true.
Check which mail servers identify your message as spam. Also check with your hosting company for their preferred method to send out mail.
Try to be straightforward with your message. Offer the users a short textarea (with your default masage), which they can change and customize. Also give the possibility to enter real name of the participants with their e-mail addresses.
Just be senible and your messas will go thru.
Send the email from your webserver and add a reply-to header like you have mentioned.
Make sure you have SPF setup for your server to help get yourself into the gMail, Live Mail and Yahoo accounts.
A nice and cheap alternative is to send your emails via Amazon SES to avoid having to warm your own IPs etc.
I would go with the Amazon SES (or a similar service) and leave the worrying about getting the server setup right to the experts. Make ensuring deliverability someone elses problem.
This article is a nice starting point:
http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html
The problem is related to the header of the email. not neccessarily the 'from' address domain. Some spam filters (i.e. cox.net incoming spam filters) will perform a reverse lookup on the IP address that the email came from. If the domain name returned on the reverse lookup is not the domain name of the sending address. Then they will liekly mark it as spam.
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....