Send email in PHP with Gmail [GMAIL-PHP]

udara1986

Member
Jun 19, 2009
112
2
0
Colombo
download attachment and extract files into folder named email inside your development folder(htdocs/mydevelopment).
then use following code to create your email messege,

require_once('../email/class.phpgmailer.php'); //path to the above folder
$mail = new PHPGMailer();
$mail->Username = '*****@gmail.com'; //SMTP username
$mail->Password = '*****'; //SMTP password
$mail->From = '[email protected]';
$mail->FromName = 'anyone';
$mail->Subject = 'php gmail';
$mail->AddAddress($email);
$mail->Body = 'this is simply great';
$mail->Send();

now you are done with it.
 

Attachments

  • phpgmail.zip
    15.1 KB · Views: 201

udara1986

Member
Jun 19, 2009
112
2
0
Colombo
////////////////////////////////////////////////////
// PHPMailer - PHP email class
//
// Class for sending email using either
// sendmail, PHP mail(), or SMTP. Methods are
// based upon the standard AspEmail(tm) classes.
//
// Copyright (C) 2001 - 2003 Brent R. Matzelle
//
// License: LGPL, see LICENSE
////////////////////////////////////////////////////

/**
* PHPMailer - PHP email transport class
* @package PHPMailer
* @author Brent R. Matzelle
* @copyright 2001 - 2003 Brent R. Matzelle
*/