close
Warning:
HTML preview using PygmentsRenderer failed (ImportError: /usr/lib/python2.7/dist-packages/libsvn/_ra.so: failed to map segment from shared object: Cannot allocate memory)
|
Last change
on this file since 137 was
57,
checked in by jazz, 17 years ago
|
- 第一版 Hadoop 叢集之帳號申請網頁 by Wade
|
|
File size:
771 bytes
|
| Rev | Line | |
|---|
| [57] | 1 | <?php
|
|---|
| 2 |
|
|---|
| 3 | include_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 |
|
|---|
| 23 | if(!$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.
Download in other formats: