Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $from="examplewebsite.com";
- $to = "example@gmail.com";
- $subject = "Hi!";
- $body = "Hi,nnHow are you?";
- $host = "https://website.com ";
- $username = "info@website.com";
- $port = "465";
- $password = "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("
- Message successfully sent!
- "); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement