hello, jcow its great!
i have a litle problam, i am trying to setup the smtp server, and its didnt working.
this is what i done, please tell me what wrong..
1- first step, i put the require_one, like this:
require_once './includes/libs/class.phpgmailer.php';
require_once './includes/libs/class.smtp.php';
require_once './includes/libs/pages.inc.php';
require_once './includes/libs/story.inc.php';
require_once './includes/libs/db.inc.php';
2- the second step,i put the "function jcow user mail" above the "function jcow mail" like this:
function client($key='') {
global $client;
if (!$key)
return $client;
else
return $client[$key];
}
function jcow_user_mail($to,$subject,$message,$reply=”){
global $config;
$mail = new PHPGMailer();
$mail->Username = $config['smtp_user'];
$mail->Password = $config['smtp_pass'];
$mail->From = $config['smtp_from'];
$mail->FromName = get_gvar('site_name');
$mail->Host=$config['smtp_host'];
$mail->Port=$config['smtp_port'];
$mail->Subject = $subject;
$mail->AddAddress($to);
$mail->Body = $message;
$mail->IsHTML=$config['smtp_html'];;
return $mail->Send();
}
function jcow_mail($to,$subject,$message,$reply = '') {
if (function_exists('jcow_user_mail')) {
return jcow_user_mail($to,$subject,$message,$reply);
}
else {
if (!$reply)
$reply = get_gvar('site_name').'noreply@'.$_SERVER['HTTP_HOST'].'';
$headers = "From: $reply\r\n" .
"Message-ID: <".time()."-".$reply.">\r\n".
'X-Mailer: PHP/' . phpversion() . "\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type: text/html; charset=utf-8 \r\n" .
"Content-Transfer-Encoding: 8bit\r\n\r\n";
// Send
3- the last step, i write the config file and put its in the end of the config.php file like this:
$config['smtp_host']='smtp.gmail.com';
$config['smtp_port']=465;
$config['smtp_auth']=true;
$config['smtp_user']='[email protected]';
$config['smtp_pass']='my password';
$config['smtp_html']=true;
$config['smtp_from']='noreply@YOURDOMAIN';
what im done wrong?
thank you very much!
|