Current location: Hot Scripts Forums » Programming Languages » PHP » phpMailer problem


phpMailer problem

Reply
  #1 (permalink)  
Old 08-21-08, 02:33 AM
umarrana umarrana is offline
Newbie Coder
 
Join Date: Dec 2006
Location: Pakistan
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
phpMailer problem

hello dear friends i am using PhpMailer smtp but when i try to send email he gives me the error

like this
Mailer Error: SMTP Error: The following recipients failed: abc@abc.com

i don't understand what is this problem

here is the my code
PHP Code:

<?php


//error_reporting(E_ALL);
error_reporting(E_STRICT);

date_default_timezone_set('America/Toronto');
//date_default_timezone_set(date_default_timezone_get());

include_once('class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

$mail             = new PHPMailer();

$body             $mail->getFile('contents.html');
$body             eregi_replace("[\]",'',$body);

$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host       "mail.greenfintech.com"// SMTP server

$mail->From       "my@greenfintech.com";
$mail->FromName   "First Last";

$mail->Subject    "PHPMailer Test Subject via smtp";

$mail->AltBody    "To view the message, please use an HTML compatible email viewer!"// optional, comment out and test

$mail->MsgHTML($body);

$mail->AddAddress("abc@abc.com""John Doe");

$mail->AddAttachment("images/phpmailer.gif");             // attachment

if(!$mail->Send()) {
  echo 
"Mailer Error: " $mail->ErrorInfo;
} else {
  echo 
"Message sent!";
}

?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 08-21-08, 04:57 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
It means abc@abc.com isn't a valid mailbox on the abc.com domain. Therefor the mail cannot be sent to that address, resulting in an smtp failure. Try replacing abc@abc.com with a valid address, and you'll see it works
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 08-21-08, 05:14 AM
umarrana umarrana is offline
Newbie Coder
 
Join Date: Dec 2006
Location: Pakistan
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
yes i am using with a valid hotmail account and i also try the my personal website account but it showing same
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 08-21-08, 08:57 PM
kvnband kvnband is offline
Wannabe Coder
 
Join Date: Jun 2003
Posts: 242
Thanks: 0
Thanked 0 Times in 0 Posts
You're connecting to an SMTP server but you're not actually logging in to the SMTP server. Since most SMTP servers require some sort of authentication, that is probably where your problem is at.

Kevin Cackler
That Script Guy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pls help website problem! iangarrinud CSS 1 01-03-08 02:48 PM
login, roles problem dbrook007 ASP.NET 10 11-10-06 04:42 PM
Form Display Problem neevrap02 Visual Basic 1 09-05-06 06:18 AM
Count problem kasic ASP.NET 1 10-20-04 01:23 AM
Asp and Microsoft Access 2002 problem gop373 ASP 2 10-06-04 10:13 AM


All times are GMT -5. The time now is 10:00 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.