~josephjamesmills/zpanelcp/zpanelcp

« back to all changes in this revision

Viewing changes to backups/zpanelx-10-zpanelx/etc/lib/PHPMailer/examples/test_sendmail_basic.php

  • Committer: Joseph Mills
  • Date: 2012-05-12 06:38:23 UTC
  • Revision ID: josephjamesmills@gmail.com-20120512063823-nnb5w44xdkkbg8ds
made new framework and got ride of the backupfiles fixed amny of the bugs or tried too at least. added steps tpwards making ssl by default. Fixed apache virtual host files and moved to the right area. fixed all things too go under /var/www. and not /etc/. changed all the persission so that no one can read all files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<html>
2
 
<head>
3
 
<title>PHPMailer - Sendmail basic test</title>
4
 
</head>
5
 
<body>
6
 
 
7
 
<?php
8
 
 
9
 
require_once('../class.phpmailer.php');
10
 
 
11
 
$mail             = new PHPMailer(); // defaults to using php "mail()"
12
 
 
13
 
$mail->IsSendmail(); // telling the class to use SendMail transport
14
 
 
15
 
$body             = file_get_contents('contents.html');
16
 
$body             = eregi_replace("[\]",'',$body);
17
 
 
18
 
$mail->AddReplyTo("name@yourdomain.com","First Last");
19
 
 
20
 
$mail->SetFrom('name@yourdomain.com', 'First Last');
21
 
 
22
 
$mail->AddReplyTo("name@yourdomain.com","First Last");
23
 
 
24
 
$address = "whoto@otherdomain.com";
25
 
$mail->AddAddress($address, "John Doe");
26
 
 
27
 
$mail->Subject    = "PHPMailer Test Subject via Sendmail, basic";
28
 
 
29
 
$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
30
 
 
31
 
$mail->MsgHTML($body);
32
 
 
33
 
$mail->AddAttachment("images/phpmailer.gif");      // attachment
34
 
$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
35
 
 
36
 
if(!$mail->Send()) {
37
 
  echo "Mailer Error: " . $mail->ErrorInfo;
38
 
} else {
39
 
  echo "Message sent!";
40
 
}
41
 
 
42
 
?>
43
 
 
44
 
</body>
45
 
</html>