Emails-old - Phpmailer, office 365
... / Phpmailer, office 365
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Frage

Phpmailer, office 365

Von
SylvainR1
Erstellungsdatum 2018-06-13 10:43:33 (edited on 2024-09-04 11:49:33) in Emails-old

Bonjour,
J'utilise phpmailer pour envoyer mes mails depuis mon site.
J'aimerai utiliser une connexion smtp (smtp.office365.com) pour envoyer ces mails, car ils arrivent tous en spam.
j'utilise ce script :
$mail = new PHPMailer(true);



$mail->isSMTP();
$mail->Host = 'smtp.office365.com';
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
$mail->SMTPAuth = true;
$mail->Username = 'dfdfdfdf@dfgdgfgdfk.fr';
$mail->Password = '###############';
$mail->SetFrom('fgfgfg@dfgdgdfgfg.fr', 'FromEmail');
$mail->addAddress('fgfgfg@dfgdfgdf.fr', 'ToEmail');
$mail->SMTPDebug = 4;
#$mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; //$mail->Debugoutput = 'echo';
$mail->IsHTML(true);

$mail->Subject = 'Here is the subject';
$mail->Body = 'Test spam ou pasThis is the HTML message body in bold!';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent';
}

Ce script fonctionne en local, car j'ai crée un connecteur sur l'office 365.
Depuis ovh, la connexion est refusé par le serveur smtp.
Je voudrais creer un connecteur pour ovh, mais je ne sais pas quelle valeur y mettre, à savoir le domaine accepté ou l'ip du serveur.
Mon domaine sur ovh, est le même que celui de office 365 (champs spf sur ovh configurer avec : v=spf1 include:spf.protection.outlook.com -all)
Quelle serait la valeur pour ce connecteur ?
Dois-je ajouter un nouveau spf ?
Merci de votre aide

Sylvain


Antworten sind derzeit für diese Frage deaktiviert.