Re: phpMailer Problem!
| From: | Al | Date: | Mon, 19 Jan 2009 16:38:41 +0000 |
| Subject: | Re: phpMailer Problem! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-286662@lists.php.net to get a copy of this message | ||
shahrzad khorrami wrote:
hi all, I want to send email using SMTP Authentication with PHPMailer, I searched more and more but I can't find anything of my problem.... /////////////////////////////////////////////////////////////////// include_once('class.phpmailer.php'); include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loadedI'd suggest using the Pear Mail package http://pear.php.net/package/Mail. It's easier to use and provides excellent error reporting. Turn on the debug flag$mail = new PHPMailer();$mail->IsSMTP();$mail->Host = "mail.xxxxxxxxxx.com"; // sets GMAIL as the SMTPserver$mail->Port = 80;$mail->Username = "website@xxxxxxx.com"; // SMTP username $mail->Password = "xxxxx"; // SMTP password$mail->From = "website@xxxxxxxxxx.com";$mail->FromName = "First Last";$mail->Subject = "PHPMailer Test Subject via smtp";$mail->AltBody = "To view the message, please use an HTML compatibleemail viewer!"; // optional, comment out and test $mail->MsgHTML("hiiii"); $mail->AddAddress("xxxxxxxxx@gmail.com", "John Doe");//$mail->AddAttachment("images/phpmailer.gif"); // attachmentif(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; } //////////////////////////////////////////////// result is nothing, no error but didn't send then I remove Username & password, but didn't work!... thanks, shahrzad khorrami