Hi,

In class.smtp.php I have :-

  var $do_debug=1;       # the level of debug to perform

However -all i'm getting is an error :-
" Mailer Error: SMTP Error: Could not connect to SMTP host. "

Near the top of the script I can find the PORT number - But no
variable to advise the smtp server

(I guess this is specified in the main php script that calls the smtp script..)

:- i have the smtp in the same directory as my other script...

QUESTION :-

How can I show a FULL debug ? (IE tell me the server it is trying to access)
instead of  "  Mailer Error: SMTP Error: Could not connect to SMTP host.  "


I'm trying Gmail

& Ive googled various scripys & all these (say that they) work....


Ive used it with & without :- $mail->IsHTML(true); // send as HTML

& the other attachment lines (I just want plain text emails)

also with & without
#$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier


Here is my script (PASSWORD changed of course :)  )


=======================

include("class.phpmailer.php");
include("class.smtp.php");

$mail=new PHPMailer();

$mail->IsSMTP();
$mail->SMTPAuth   = yes;                  // enable SMTP authentication
#$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
$mail->Port       = 465;                   // set the SMTP port

$mail->Username   = "[EMAIL PROTECTED]";  // GMAIL username
$mail->Password   = "PASSWORD";            // GMAIL password

$mail->From       = "[EMAIL PROTECTED]";
$mail->FromName   = "Gordon";
$mail->Subject    = "$subject";
$mail->Body       = "$message<br>";                      //HTML Body
$mail->AltBody    = "$message"; //Text Body

$mail->WordWrap   = 50; // set word wrap

$mail->AddAddress("$to");
$mail->AddReplyTo("[EMAIL PROTECTED]","Webmaster");
#$mail->AddAttachment("/path/to/file.zip");             // attachment
#$mail->AddAttachment("/path/to/image.jpg", "new.jpg"); // attachment
$mail->IsHTML(true); // send as HTML

if(!$mail->Send()) {
  echo "Mailer Error: " . $mail->ErrorInfo;
echo "\n\n";
exit;
} else {
  echo "Gmail Message has been sent\n\n";
}


-- 
G
NZ community groups - [EMAIL PROTECTED]
Freecycle Auckland :-
http://groups.yahoo.com/group/AucklandFreecycle/

Reply via email to