Posted By

fruehjahr on 01/05/09


Tagged

mail smtp sending


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

jfherring
umang_nine


Sending mail


 / Published in: PHP
 

URL: http://phpmailer.codeworxtech.com/

  1. include("class.phpmailer.php");
  2. $mail = new PHPMailer();
  3. $mail->From = '[email protected]';
  4. $mail->FromName = 'HTML Blog';
  5. $mail->Host = 'smtp.site.com';
  6. $mail->Mailer = 'smtp';
  7. $mail->Subject = 'My Subject';
  8. $mail->IsHTML(true);
  9. $body = 'Hello<br/>How are you ?';
  10. $textBody = 'Hello, how are you ?';
  11. $mail->Body = $body;
  12. $mail->AltBody = $textBody;
  13. $mail->AddAddress('asvin [@] gmail.com');
  14. if(!$mail->Send())
  15. echo 'There has been a mail error !';

Report this snippet  

You need to login to post a comment.