/dev/adei-asec

To get this branch, use:
bzr branch http://darksoft.org/webbzr/dev/adei-asec

« back to all changes in this revision

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

  • Committer: Suren A. Chilingaryan
  • Date: 2011-03-15 02:47:05 UTC
  • mfrom: (210.1.3 adei)
  • Revision ID: csa@dside.dyndns.org-20110315024705-qljn30gwin8yrkne
Integration of work of students with fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
<title>PHPMailer - Mail() advanced test</title>
 
4
</head>
 
5
<body>
 
6
 
 
7
<?php
 
8
 
 
9
require_once('../class.phpmailer-lite.php');
 
10
 
 
11
$mail             = new PHPMailerLite(); // defaults to using php "Sendmail" (or Qmail, depending on availability)
 
12
 
 
13
$mail->IsMail(); // telling the class to use native PHP mail()
 
14
 
 
15
try {
 
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
 
23
  $mail->Send();
 
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!
 
29
}
 
30
?>
 
31
</body>
 
32
</html>