| Line | |
|---|
| 1 | <html> |
|---|
| 2 | <head> |
|---|
| 3 | <title>POP before SMTP Test</title> |
|---|
| 4 | </head> |
|---|
| 5 | |
|---|
| 6 | <body> |
|---|
| 7 | |
|---|
| 8 | <pre> |
|---|
| 9 | <?php |
|---|
| 10 | require 'class.phpmailer.php'; |
|---|
| 11 | require 'class.pop3.php'; |
|---|
| 12 | |
|---|
| 13 | $pop = new POP3(); |
|---|
| 14 | $pop->Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1); |
|---|
| 15 | |
|---|
| 16 | $mail = new PHPMailer(); |
|---|
| 17 | |
|---|
| 18 | $mail->IsSMTP(); |
|---|
| 19 | $mail->SMTPDebug = 2; |
|---|
| 20 | $mail->IsHTML(false); |
|---|
| 21 | |
|---|
| 22 | $mail->Host = 'relay.example.com'; |
|---|
| 23 | |
|---|
| 24 | $mail->From = 'mailer@example.com'; |
|---|
| 25 | $mail->FromName = 'Example Mailer'; |
|---|
| 26 | |
|---|
| 27 | $mail->Subject = 'My subject'; |
|---|
| 28 | $mail->Body = 'Hello world'; |
|---|
| 29 | $mail->AddAddress('name@anydomain.com', 'First Last'); |
|---|
| 30 | |
|---|
| 31 | if (!$mail->Send()) |
|---|
| 32 | { |
|---|
| 33 | echo $mail->ErrorInfo; |
|---|
| 34 | } |
|---|
| 35 | ?> |
|---|
| 36 | </pre> |
|---|
| 37 | |
|---|
| 38 | </body> |
|---|
| 39 | </html> |
|---|
Note: See
TracBrowser
for help on using the repository browser.