3
<title>PHPMailer - Sendmail advanced test</title>
9
require_once('../class.phpmailer-lite.php');
11
$mail = new PHPMailerLite(true); // the true param means it will throw exceptions on errors, which we need to catch
12
$mail->IsSendmail(); // telling the class to use SendMail transport
15
$mail->SetFrom('me@you.com', 'Toni Pirhonen');
16
$mail->AddAddress('torrenttiposti@gmail.com', 'Toni Pirhonen');
17
$mail->Subject = 'Testi, jospa oiski näi heleppoo :D';
18
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
19
$mail->MsgHTML(file_get_contents('contents.html'));
20
$mail->AddAttachment('images/phpmailer.gif'); // attachment
21
$mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
23
echo "Message Sent OK</p>\n";
24
} catch (phpmailerException $e) {
25
echo $e->errorMessage(); //Pretty error messages from PHPMailer
26
} catch (Exception $e) {
27
echo $e->getMessage(); //Boring error messages from anything else!