IsSMTP(); $mail->Host='smtp.machin.com'; $mail->port=25; $mail->From='booz@machin.com'; $mail->AddAddress('booz@machin.net'); $mail->AddReplyTo('booz@machin.net'); $mail->Subject='ceci n\'est pas un test'; $mail->SMTPAuth = true; $mail->Username = "booz@machin.com"; $mail->Password = "toto"; $mail->AddStringAttachment("IMG/auton4.jpg", "Logo.jpg"); // HTML body $body = "Hello BoOz,

"; $body .= "Your personal photograph to this message.

"; $body .= "Sincerely,
"; $body .= "PHPMailer List manager"; // Plain text body (for mail clients that cannot read HTML) $text_body = "Hello, \n\n"; $text_body .= "Your personal photograph to this message.\n\n"; $text_body .= "Sincerely, \n"; $text_body .= "PHPMailer List manager"; $mail->Body = $body; $mail->AltBody = $text_body; $mail->AddAddress("cedric@bidule.com","Cedribox"); $mail->AddStringAttachment("IMG/siteon0", "YourPhoto.jpg"); if(!$mail->Send()){ //Teste le return code de la fonction echo $mail->ErrorInfo; //Affiche le message d'erreur (ATTENTION:voir section 7) } else{ echo 'Mail envoye avec succes'; } $mail->SmtpClose(); // Clear all addresses and attachments for next loop $mail->ClearAddresses(); $mail->ClearAttachments(); unset($mail); //envoi par mail(); #$mail->Mailer = "mail"; //envoi format html seul #$mail->IsHTML(); //envoi format texte seul #$mail->IsTEXT(); ?>