Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require_once "Mail.php";
- $from = "myemail@email.com";
- $to = "test@email.com";
- $subject = "Test";
- $body = "Hello";
- $host = "mail.mysite.com";
- $port = "myport";
- $username = "myemail@email.com";
- $password = "my_password";
- $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());
- } else {
- echo("success!");
- }
Add Comment
Please, Sign In to add comment