/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_mail_basic.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 - Mail() basic 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
$body             = file_get_contents('contents.html');
 
16
$body             = eregi_replace("[\]",'',$body);
 
17
 
 
18
$mail->SetFrom('name@yourdomain.com', 'First Last');
 
19
 
 
20
$address = "whoto@otherdomain.com";
 
21
$mail->AddAddress($address, "John Doe");
 
22
 
 
23
$mail->Subject    = "PHPMailer Test Subject via mail(), basic";
 
24
 
 
25
$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
 
26
 
 
27
$mail->MsgHTML($body);
 
28
 
 
29
$mail->AddAttachment("images/phpmailer.gif");      // attachment
 
30
$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
 
31
 
 
32
if(!$mail->Send()) {
 
33
  echo "Mailer Error: " . $mail->ErrorInfo;
 
34
} else {
 
35
  echo "Message sent!";
 
36
}
 
37
 
 
38
?>
 
39
 
 
40
</body>
 
41
</html>