/openshift/adei

To get this branch, use:
bzr branch http://darksoft.org/webbzr/openshift/adei

« back to all changes in this revision

Viewing changes to includes/PHPMailer-Lite_v5.1/examples/test_sendmail_advanced.php

  • Committer: Suren A. Chilingaryan
  • Date: 2011-01-26 02:48:39 UTC
  • mto: This revision was merged to the branch mainline in revision 212.
  • Revision ID: csa@dside.dyndns.org-20110126024839-nv6qp2ie9stmd2dn
Support of Appled devices by Toni Pirhonen

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
<title>PHPMailer - Sendmail advanced test</title>
 
4
</head>
 
5
<body>
 
6
 
 
7
<?php
 
8
 
 
9
require_once('../class.phpmailer-lite.php');
 
10
 
 
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
 
13
 
 
14
try {
 
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
 
22
  $mail->Send();
 
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!
 
28
}
 
29
?>
 
30
 
 
31
</body>
 
32
</html>