source: hadoop-register/etc/phpMailer/examples/test_mail.php @ 57

Last change on this file since 57 was 57, checked in by jazz, 15 years ago
  • 第一版 Hadoop 叢集之帳號申請網頁 by Wade
File size: 771 bytes
Line 
1<?php
2
3include_once('../class.phpmailer.php');
4
5$mail             = new PHPMailer(); // defaults to using php "mail()"
6
7$body             = $mail->getFile('contents.html');
8$body             = eregi_replace("[\]",'',$body);
9
10$mail->From       = "name@yourdomain.com";
11$mail->FromName   = "First Last";
12
13$mail->Subject    = "PHPMailer Test Subject via mail()";
14
15$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
16
17$mail->MsgHTML($body);
18
19$mail->AddAddress("whoto@otherdomain.com", "John Doe");
20
21$mail->AddAttachment("images/phpmailer.gif");             // attachment
22
23if(!$mail->Send()) {
24  echo "Mailer Error: " . $mail->ErrorInfo;
25} else {
26  echo "Message sent!";
27}
28
29?>
Note: See TracBrowser for help on using the repository browser.