Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once "Mail.php";
- $from = "mmccabe1993@gmail.com";
- $to = "mmccabe1993@gmail.com";
- $subject = "Email Test...";
- $body = "What's up.\n\n\nSent via PHP.";
- $host = "smtp.gmail.com";
- $port = "465";
- $username = "mmccabe1993@gmail.com";
- $password = "wh4t1smyp455w0rd";
- $headers = array ( 'From' => $from,
- 'To' => $to,
- 'Subject' => $subject);
- $smtp = Mail::factory('smtp',
- array ( 'host' => $host,
- 'port' => $port,
- 'auth' => true,
- 'username' => $username,
- 'password' => $password
- )
- );
- $mail = $smtp->send($to, $headers, $body);
- if ( PEAR::isError($mail) )
- echo $mail->getMessage() + "<br>";
- else
- echo "Mail successfully sent!<br>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement