
April 17th, 2007, 01:35 PM
|
|
Registered User
|
|
Join Date: Apr 2007
Posts: 22,309
Time spent in forums: < 1 sec
Reputation Power: 24
|
|
|
PEAR script dies with gmail
Hi
Im using PEAR to connect to gmail and when i run the script it just dies and doesnt mail im not sure why this is but here is my code:
php Code:
Original
- php Code |
|
|
|
<?php require "Mail.php"; $from = "username@gmail.com"; $to = "anotherusername@gmail.com"; $subject = "Hi!"; $body = "Hi,nnHow are you?"; $host = "smtp.gmail.com"; $username = "administrator@mydomain.com"; $password = "mypass"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail:: factory('smtp', 'port' => 465, 'localhost' => "68.41.185.216", 'auth' => TRUE, 'username' => $username, 'password' => $password, 'debug' => TRUE )); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo("<p>" . $mail-> getMessage() . "</p>"); } else { echo("<p>Message successfully sent!</p>"); } ?>
a link to the script running is
http://watchyourhousesell.com/t.php
Does anyone have any ideas as to why this script dies when it sends the email??
Thanks
|