Mail from your php code

Submitted by:Andery Smith

Date added:01 October, 2013

Category:PHP

This php code for mail someone from your code

Tags: mail

Code Snippet:

 <?php
include("class.phpmailer.php");
$mail = new PHPMailer();
$mail->From = 'your email address@.com';
$mail->FromName = 'HTML Blog';
$mail->Host = 'host name';
$mail->Mailer = 'smtp';
$mail->Subject = 'subject';
$mail->IsHTML(true);
$body = 'Hello<br/>How are you ?';
$textBody = 'Hello, how are you ?';
$mail->Body = $body;
$mail->AltBody = $textBody;
$mail->AddAddress('reciepents full email address');
if(!$mail->Send())
echo 'There has been a mail error !';
 
 

Comments