~josephjamesmills/zpanelcp/zpanelcp

« back to all changes in this revision

Viewing changes to backups/zpanelx-10-zpanelx/etc/lib/PHPMailer/examples/test_pop_before_smtp_advanced.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>POP before SMTP Test</title>
4
 
</head>
5
 
<body>
6
 
 
7
 
<?php
8
 
require_once('../class.phpmailer.php');
9
 
require_once('../class.pop3.php'); // required for POP before SMTP
10
 
 
11
 
$pop = new POP3();
12
 
$pop->Authorise('pop3.yourdomain.com', 110, 30, 'username', 'password', 1);
13
 
 
14
 
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
15
 
 
16
 
$mail->IsSMTP();
17
 
 
18
 
try {
19
 
  $mail->SMTPDebug = 2;
20
 
  $mail->Host     = 'pop3.yourdomain.com';
21
 
  $mail->AddReplyTo('name@yourdomain.com', 'First Last');
22
 
  $mail->AddAddress('whoto@otherdomain.com', 'John Doe');
23
 
  $mail->SetFrom('name@yourdomain.com', 'First Last');
24
 
  $mail->AddReplyTo('name@yourdomain.com', 'First Last');
25
 
  $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
26
 
  $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
27
 
  $mail->MsgHTML(file_get_contents('contents.html'));
28
 
  $mail->AddAttachment('images/phpmailer.gif');      // attachment
29
 
  $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
30
 
  $mail->Send();
31
 
  echo "Message Sent OK</p>\n";
32
 
} catch (phpmailerException $e) {
33
 
  echo $e->errorMessage(); //Pretty error messages from PHPMailer
34
 
} catch (Exception $e) {
35
 
  echo $e->getMessage(); //Boring error messages from anything else!
36
 
}
37
 
?>
38
 
 
39
 
</body>
40
 
</html>