0
votes

I bought a cloud server web in 1and1 and I need to confifure myself the server. I trying to submit mails in Plesk but I have this error

spf=neutral (google.com: 82.165.121.94 is neither permitted nor denied by best guess record for domain of [email protected]) [email protected]; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com

I'm trying to add a SPF and Dmarc in the DNS settings, but I have got my mails in SPAM.

SPF config = TXT v=spf1 -all
DMARC config = v=DMARC1; p=none

I dont understand why my mails are again in spam.

Look at my PHP Mail Submit :

<?php
$to = "[email protected]";
$subject = "Contact Site Internet";

$message = "
<html>
<head>
<title>Site Projet </title>
</head>
<body>
<p>Cet email est un test</p>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
</tr>
</table>
</body>
</html>
";

// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

// More headers
$headers .= 'From: <[email protected]>' . "\r\n";

mail($to,$subject,$message,$headers);
echo 'fait!';
?>

Thx for helping

1

1 Answers

0
votes

It's because you're forging the from address; You're sending from your local server but using a gmail From address. Gmail doesn't allow you to send messages from gmail addresses from non-gmail servers, so either change your from address to one you are allowed to send from, or rewrite your script to send through gmail, such as by using PHPMailer.