help in using phpmailer with gmail

Recommend this page to a friend!

      PHPMailer  >  All threads  >  help in using phpmailer with gmail  >  (Un) Subscribe thread alerts  
Subject:help in using phpmailer with gmail
Summary:helps needed in phpmailer
Author:nagendra prasad
Date:2006-07-09 12:05:20
Update:2010-01-05 07:35:02


  1. help in using phpmailer with gmail   Reply   Report abuse  
Picture of nagendra prasad nagendra prasad - 2006-07-09 12:05:20
I have been trying to use my gmail account to generate a mail in php. i have used the php mailer class for the same. i have done the folowing change in the class.smtp.php file:

Pasted this code
$host = "ssl://";
$port = 465;
before the line 104 #connect to the smtp server

Next i have used the following code as my mail.php file which will generate the mail:

$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = ""; // SMTP username
$mail->Password = "password"; // SMTP password
$webmaster_email = ""; //Reply to this email ID
$email=""; // Recipients email ID
$name="name"; // Recipient's name
$mail->From = $webmaster_email;
$mail->FromName = "Webmaster";
$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(true); // send as HTML
$mail->Subject = "This is the subject";
$mail->Body = "Hi,
This is the HTML BODY "; //HTML Body
$mail->AltBody = "This is the body when user views in plain text format"; //Text Body
echo "Mailer Error: " . $mail->ErrorInfo;
echo "Message has been sent";

but i am getting the following error...

Fatal error: Maximum execution time of 60 seconds exceeded in D:\wamp\www\class.smtp.php on line 1024

Can anyone please give the correct settings that has to be done in the class files...or is there any other class files tht are available to send a mail using the gmail account..plz help

  2. Re: help in using phpmailer with gmail   Reply   Report abuse  
Picture of pradeep lance pradeep lance - 2010-01-05 07:35:02 - In reply to message 1 from nagendra prasad
thanks bro its working

For more information send a message to info at phpclasses dot org.