I'm implementing an auto email sender, Actually when I try to send my email automatically to a Gmail account, the mail is received, however when i try to send the same email to another mail domain (ex. @bouygues-construction.com), the PHP script say the email has been send but nothing is received... I'm using ionos (1&1) server mail :
$data = file_get_contents("php://input");
$dataAsJson = json_decode($data);
$mail = new PHPMailer(true);
try{
$mail->IsSMTP();
$mail->Mailer = "mail";
$mail->SMTPAuth = true;
$mail->Host = "smtp.ionos.fr";
$mail->Port = 587; //465;
$mail->SMTPDebug = 2;
$mail->SMTPSecure = 'tls';
$mail->Username = "******";
$mail->Password = "******";
$mail->Sender = "tpings@mydomain.fr";
$mail->From = "tpings@mydomain.fr";
$mail->AddAddress($dataAsJson->Email,$dataAsJson->Nom." ".$dataAsJson->Prenom);
$mail->Subject = "Licence";
$mail->FromName = "TPINGS Service";
$mail->AddReplyTo('exemple@exemple.com', 'Contact TPINGS' );
if($dataAsJson->English == true){
$msg = "myMsg";
$mail->AddAttachment("./uploads/Installation_EN.pdf");
}else{
$msg = "my_FR_msg";
$mail->AddAttachment("./uploads/Installation_FR.pdf");
}
$mail->MsgHTML($msg);
if(!$mail->Send()) {
http_response_code(500);
echo 'Erreur : ' . $mail->ErrorInfo;
} else {
http_response_code(200);
}
}catch(Exception $e){
echo "Erreur mail : ".$mail->ErrorInfo;
}
Sidenote: my spam folder is empty.