3
* Simple example script using PHPMailer with exceptions enabled
8
require '../class.phpmailer-lite.php';
11
$mail = new PHPMailerLite(true); //New instance, with exceptions enabled
13
$body = file_get_contents('contents.html');
14
$body = preg_replace('/\\\\/','', $body); //Strip backslashes
16
$mail->AddReplyTo("name@domain.com","First Last");
18
$mail->SetFrom('you@yourdomain.com', 'Your Name');
20
$to = "someone@example...com";
22
$mail->AddAddress($to);
24
$mail->Subject = "First PHPMailer Message";
26
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
27
$mail->WordWrap = 80; // set word wrap
29
$mail->MsgHTML($body);
31
$mail->IsHTML(true); // send as HTML
34
echo 'Message has been sent.';
35
} catch (phpmailerException $e) {
36
echo $e->errorMessage();
b'\\ No newline at end of file'