Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- try {
- require_once "Mail.php";
- require_once "Mail/mime.php";
- $from = "support@domain.com";
- $to = "user@gmail.com";
- $subject = "Testing email please ignore";
- $message = "Just testing";
- $host = "godaddyhost";
- $port = "465";
- $username = "support@domain.com";
- $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, $message);
- if (PEAR::isError($mail)) {
- echo("<p>" . $mail->getMessage() . "</p>");
- } else {
- echo("<p>Message successfully sent!</p>");
- }
- } catch(Exception $e) {
- echo $e;
- }
- ?>
- This page isn’t working
- localhost is currently unable to handle this request.
- HTTP ERROR 500
Add Comment
Please, Sign In to add comment