3
<title>PHPMailer - Mail() advanced test</title>
9
require_once('../class.phpmailer-lite.php');
11
$mail = new PHPMailerLite(); // defaults to using php "Sendmail" (or Qmail, depending on availability)
13
$mail->IsMail(); // telling the class to use native PHP mail()
16
$mail->SetFrom('name@yourdomain.com', 'First Last');
17
$mail->AddAddress('Suren.Chilingaryan@kit.edu', 'John Doe');
18
$mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
19
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
20
$mail->MsgHTML(file_get_contents('contents.html'));
21
$mail->AddAttachment('images/phpmailer.gif'); // attachment
22
$mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
24
echo "Message Sent OK</p>\n";
25
} catch (phpmailerException $e) {
26
echo $e->errorMessage(); //Pretty error messages from PHPMailer
27
} catch (Exception $e) {
28
echo $e->getMessage(); //Boring error messages from anything else!