source: spip-zone/_plugins_/_email_/phpmailer/phpmailer.html @ 4293

Last change on this file since 4293 was 4293, checked in by cedric@…, 14 years ago

hop la c'est bon

File size: 781 bytes
Line 
1<?php
2
3include_spip('class.phpmailer');
4include_spip('class.smtp');
5
6
7$mail = new PHPMailer();
8
9$mail->IsSMTP();
10$mail->Host='smtp.machin.com';
11$mail->port=25;
12$mail->From='booz@machin.com';
13$mail->AddAddress('booz@rezo.net');
14$mail->AddReplyTo('booz@machin.net');   
15$mail->Subject='ceci n\'est pas un test';
16$mail->Body='Voici un exemple d\'e-mail au format Texte';
17$mail->SMTPAuth = true;
18$mail->Username = "booz@machin.com";
19$mail->Password = "toto";
20$mail->AddStringAttachment("IMG/auton4.jpg", "Logo.jpg");
21
22if(!$mail->Send()){ //Teste le return code de la fonction
23  echo $mail->ErrorInfo; //Affiche le message d'erreur (ATTENTION:voir section 7)
24}
25else{
26  echo 'Mail envoye avec succes';
27}
28$mail->SmtpClose();
29unset($mail);
30
31//envoi par mail();
32#$mail->Mailer   = "mail";
33
34?>
Note: See TracBrowser for help on using the repository browser.