Tossnet
25/04/2014, 10h19
ok merci. Je vais donc repartir utiliser mail()
telnet smtp.mondomaine.com 5025
require_once('/homez.56/mondomaine/www/in/libraries/PHPMailer-master/PHPMailerAutoload.php');
$mail = new PHPMailer();
$mail->isSMTP();
$mail->Host = 'smtp.mondomaine.com';
$mail->SMTPAuth = true;
$Mail->SMTPDebug = 1;
$mail->Username = 'noreply%mondomaine.com';
$mail->Password = 'MONMOTDEPASSE';
//$mail->SMTPSecure = 'ssl';//'tls';
$mail->Port =5025;
$mail->From = 'noreply@mondomaine.com';
$mail->FromName = 'Service client';
$mail->addAddress($emailTo, $nomTo);
$mail->addBCC('webmaster@mondomaine.com');
$mail->addAttachment($path.$filename, $filename);
$mail->isHTML(true);
$mail->Subject = 'Votre devis';
$mail->AltBody = 'Si vous ne visualisez pas ce message, utiliser un logiciel de messagerie compatible avec le format HTML';
$body = file_get_contents($page);
$body = preg_replace("`\[\]`s",'',$body);
$mail->MsgHTML($body);
if(!$mail->send()) {
echo 'Message could not be sent.
';
echo 'Mailer Error: ' . $mail->ErrorInfo;
}
else
{
echo "file sended"."
";
}