Mail-Tester.com : Freemail in Reply-To, but not From - php

I can not solve the problem of spam. I only have 7.6 / 10 on Mail-Tester.com.
I specify that I use postfix, and I need it only for the sendings.
Here is my result: https://www.mail-tester.com/web-n0z33
Mail-Tester.com tells me that the problem come from ReplyTO… But I am obliged well to use ReplyTO so that I can click "to answer" when I receives an e-mail sent since a form of contact of my Web site.
I also specify that FROM I put an email address #my-domain.fr. Because if in FROM I directly put the email address of the visitor who fills my contact form I have even worse errors with Mail-Tester.com.
And here is my PHP code:
$mailer = new Mailer();
$mailer->setFrom(contact#mondomaine.fr)
->setReplyTo('emailexemple#gmail.com')
->setTo($_GET['mail'])
->setSubject($data['subject'])
->setBody('front/specific-page/contact/contact-html', $data)
->addBodyText('front/specific-page/contact/contact-text', $data);
var_dump($mailer->send());
I use SwiftMailer with the driver at 'mail', but I created my own adapter so that's why I have this code. But it is easy to understand.
How to solve my problem? How to have a 10/10 rating with Mail-Tester.com?
Thank you very much.

I am sitting with the same problem. Currently, from what I have found on the net, you can not "fix" this. However, there are some ways to help resolve it. Here are a few options you can try, based on these references:
Ref 1
Ref 2
They both say the following:
"Wrap mail messages in HTML tags to avoid spam filters."

The FROM address must be those from the visitor who uses the contact form. How would you else respond to the email? And why even use a tool to test the spam score of an email sent with a contact form? You are the only receiver of those emails.
The 10/10 rating with Mail-Tester.com is telling you only, that Mail-Tester thinks, that your email is just fine. I would not rely too much on this tool. All email service providers have anyway own spam filters and will handle your email as they see right. For instance, if you test your email with another tool like https://www.emailchecky.com, you will mostly see other results and found errors.
Or make another test:
You can send the email also to a Gmail address and see if the email is landing in the main inbox or the spam folder instead. Gmail has the most aggressive spam filters and rules I know. If your email will pass these rules and filters you can be proud of your email.

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.

Using PHP Mailer to send smtp emails from an email address outside the local server

I want to use PHPMailer configure the contact page for my website. The prroblem I am facing is that for the script to work, the from address has to be set in the local server e.g. if my domain is example.com, the from address has to be name#example.com. When I set it this way, the script works perfectly.
the issue I'm having is that being a contact page, the from address has to be the senders email address this there for means that if a customer contacts me with the email address like name#email.com, the script will throw an error similar to the one below:
SMTP ERROR: DATA END command failed:
550-Your FROM address ( name#email.com , Dev Customer 550-)
must match your authenticated email user ( name#example.com ).
Does anyone have any idea on a way to work around this? Or are there any alternatives? I will appreciate any form of assistance offered. Thank you in advance.
As per Tigger's suggestion, you should never send using the submitter's address as a From address. It's forgery, and will make your messages fail SPF checks, causing you no end of delivery problems either with messages bouncing or consigned to spam folders. It's been actively advocated against for at least a decade anyway, and it's also one of the practices that would cause you to be vulnerable to the security hole in PHPMailer fixed back in December.
Since you've tagged this with PHPMailer, I'll show how to use that to do what you ask:
$mail->setFrom('me#example.com', 'Contact form');
$mail->addReplyTo($_POST['email'], $_POST['name']);
This is exactly what the example contact form script provided with PHPMailer does. It's also worth checking submitted values - addReplyTo will validate the address automatically, so you should check the return value to be sure.
There may be some email clients that do not handle reply-to addresses correctly, but you should not expose yourself to being blacklisted because of the ineptitude of a small number of clients.

Authenticate Email PHP

I have a web app which needs to send emails to clients 'From' staff email addresses. What's the best way to prevent my messages from being flagged as spam?
For instance, if I own charles#gmail.com, I'd like to be able to send mail "From" that address with PHP in my App, without getting the "This message may not have been sent by...." message.
Right now I'm just using the mail() function within PHP, with Headers for the From, Return Path, and X-Mailer variables.
I'm generally pretty confused by everything I've read so far about SPF and DKIM, so I appreciate any advice. Thanks.
This is a very lengthy subject with lots of things to consider.
The most important rule is to not use HTML and to send only correct mails that people want, and that the recipients do not flag as spam theirselves.
For instance, if I own
charles#gmail.com, I'd like to be able
to send mail "From" that address with
PHP in my App, without getting the
"This message may not have been sent
by...." message.
If you own a gmail address you could just sent the messages via gmail's SMTP service, but keep in mind that gmail has a 500 email sent limit. Below is a topic describing how to use gmail's SMTP server with the popular PHPMailer.
Right now I'm just using the mail()
function within PHP, with Headers for
the From, Return Path, and X-Mailer
variables.
Outsourcing this is probably the way to go using for example:
http://sendgrid.com/
We also offer a Free Plan with 200
Email Credits per day.
To read pricing visit http://sendgrid.com/pricing.html
http://elasticemail.com/
No monthly committments, no minimums,
no limits. Just pay for what you use
at $0.001 / email or less.
http://aws.amazon.com/ses/
Email messages are charged at $0.10
per thousand.
http://aws.amazon.com/ses/pricing/
http://www.cloudsmtp.com/
http://postmarkapp.com/
Just to name a few which are very cheap to use without any hassle/setup.
If instead of using the mail() function, you use an SMTP mailer such as the PEAR mailer package then you can send the mail using google's own SMTP servers. This will require you to provide the correct credentials to the google account you wish to send from. This should avoid the issue you are having.
One of the first things you need to ensure is that the email "From:..." really is from your server e.g your_mailings#yourcompany.com and it must exist and be a valid email on the server where the script works. You should try setting the sendmail user at the top of your script (assumes Linux server):
ini_set('sendmail_from', 'your_email#your_server.com');
Then you add a "Reply-To:" header and use your staff addresses perhaps and recipients will at least seem to have got an email that can be replied to. Without that you probably won't even get as far as being spam, you will get blocked on the way there.
This thread shows some of that and note the comments on PHPMailer - it is a good way to handle mailing and I have found it more successful than simple mail();
PHP mail form isn't working

PHP - Send email from other domain without being spam!

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.

php send email from another domain

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.

Categories