Page 1 of 1

Error in mail sending

Posted: Sat Apr 18, 2009 7:16 am
by asmitacp
I am using following code to send mail.

1. require_once('class.phpmailer.php');
2.
3. $msg = new PHPMailer();
4.
5. $msg->IsSMTP();
6. $msg->Host = "ssl://smtp.gmail.com:465";
7. $msg->SMTPAuth = true;
8. $msg->Username = 'username@mail.com';
9. $msg->Password = 'password';
10.
11. $msg->From = 'john@example.com';
12. $msg->FromName = 'John Doe';
13. $msg->AddAddress('cindy@somewhere.com');
14. $msg->Subject = 'Testing';
15. $msg->Body = 'Hello there';
16. $msg->Sender = $msg->From; // for Return-path
17.
18. if (!$msg->Send()) die('epic fail...');


But it sends error that could not connect to smpt.