Example Code PHPMailer

Here is an example for the use of the class: class.phpmailer.php Here
you have to download the files from PHPMailer and upload them in your space:



https://github.com/PHPMailer/PHPMailer


Below is just an example code,:


require("class.phpmailer.php");

$mail= newPHPMailer();$mail= newPHPMailer();

$mail->IsSMTP();// Let PHPMailer use an smtp server.

$mail->Host="smtp.myhostingpartner.co.uk";// SMTP server from My Hosting Partner

$mail->SMTPAuth=true;

$mail->Username='smtpusername';// A valid email address created at My Hosting Partner.
$mail->Password='smtppassword';// The password that belongs to the email address

$mail->From="email@website.nl";
$mail->FromName="Email from my website";
$mail->Sender="email@website.nl";// Header for return

$mail->AddAddress("email@voorbeeld.nl");// The email address to which it should be sent
$mail->Subject="Subject";

$mail->IsHTML(true);//Format of the email is in HTML

$mail->Body="

Test 1 of PHPMailer

This is a test

";
$mail->AltBody="Alternative text (plain text if html not supported)";


if(!
$mail->Send())
{
echo

"Error sending: ".$mail->ErrorInfo;;
}
else
{
echo



"The message has been sent";
}




?>