PHPMailer updated to latest version 2.3
[core.git] / inc / classes / third_party / php_mailer / examples / pop3_before_smtp_test.php
diff --git a/inc/classes/third_party/php_mailer/examples/pop3_before_smtp_test.php b/inc/classes/third_party/php_mailer/examples/pop3_before_smtp_test.php
new file mode 100644 (file)
index 0000000..b10b5e1
--- /dev/null
@@ -0,0 +1,39 @@
+<html>
+<head>
+<title>POP before SMTP Test</title>
+</head>
+
+<body>
+
+<pre>
+<?php
+  require 'class.phpmailer.php';
+  require 'class.pop3.php';
+
+  $pop = new POP3();
+  $pop->Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1);
+
+  $mail = new PHPMailer();
+
+  $mail->IsSMTP();
+  $mail->SMTPDebug = 2;
+  $mail->IsHTML(false);
+
+  $mail->Host     = 'relay.example.com';
+
+  $mail->From     = 'mailer@example.com';
+  $mail->FromName = 'Example Mailer';
+
+  $mail->Subject  =  'My subject';
+  $mail->Body     =  'Hello world';
+  $mail->AddAddress('name@anydomain.com', 'First Last');
+
+  if (!$mail->Send())
+  {
+    echo $mail->ErrorInfo;
+  }
+?>
+</pre>
+
+</body>
+</html>