Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('Mail.php');
- $from = "mail@domain.com";
- $to = "lerenarzp2@gmail.com";
- $subject = "SMTP Test";
- $body = "Testing SMTP() mail functionality";
- $date = date("D, d M Y H:i:s O");
- $host = "mail.domain.com";
- $username = "mail@domain.com";
- $password = "PASSWORD";
- $port = "587";
- $headers = array ('From' => $from,
- 'To' => $to,
- 'Subject' => $subject,
- 'Date' => $date);
- $smtp = Mail::factory('smtp',
- array ('host' => $host,
- 'port' => $port,
- 'auth' => true,
- 'username' => $username,
- 'password' => $password, 'localhost' => $host));
- $mail = $smtp->send($to, $headers, $body);
- if (PEAR::isError($mail)) {
- echo("<p>" . $mail->getMessage() . "</p>");
- } else {
- echo("<p>SMTP message successfully sent!</p>");
- }
- echo realpath('Mail.php');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement