471,831 Members | 812 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,831 software developers and data experts.

smtp error in phpmailer


i have the error when using phpmailer to send mail..

"error in sending mail: SMTP Error: The following recipients failed: me@domain.com"

if anybody knows the solution..please help me..

thanks in advance,

Dec 27 '06 #1
6 20811
4,258 Expert 4TB
I am certain that me@domain.com is not a valid email recipient. You probably have not done the required setup/customization of your phpmailer script, more specific the default addresses that are specified in that template.

Ronald :cool:
Dec 27 '06 #2

thanks for immediate reply..

my php code is:
Expand|Select|Wrap|Line Numbers
  1. require('phpmailer/class.phpmailer.php');
  2. if(isset($_POST['Submit']))
  3. {
  4.     $mail = new PHPMailer();
  5.     $mail->IsSMTP(); // telling the class to use SMTP
  6.     $mail->SMTPAuth = "true";
  7.     $mail->Host="smtp.gmail.com";
  8.     $mail->From = "sxs@gmail.com";
  9.     $mail->AddAddress("sugunat97@gmail.com");
  10.     $mail->CharSet='iso-8859-1';
  11.     $mail->ContentType='text/plain';
  12.     $mail->Subject = "Service Transcription Details";
  13.     $body='Name :'.$_POST['name']."\n";
  14.     $body.='Company :'.$_POST['company']."\n";
  15.     $body.='City/State/Zip :'.$_POST['postcode']."\n";    
  16.     $body.='Phone :'.$_POST['phone']."\n";
  17.     $body.='Fax :'.$_POST['fax']."\n";
  18.     $body.='E-mail :'.$_POST['email']."\n";
  19.     $body.='Which Transcription Service are interested in :'.$_POST['service']."\n";
  20.     $body.='Delivery :'.$_POST['delivery']."\n";
  21.     $body.='Audio/Video Media Digital :'.$_POST['media']."\n";
  22.     $body.='How do you found us? :'.$_POST['find'];
  23.     $mail->Body=$body;
  25.     if($mail->Send())
  26.     {
  27.         echo '<script language="javascript">alert("mail has sent successfully")</script>';
  28.     }
  29.     else 
  30.     {
  31.         echo 'error in sending mail: '.$mail->ErrorInfo;
  32.         $mail->ClearAddresses();
  33.         $mail->ClearAttachments();
  34.     }
  35. }
Next time define your code within tags as stated in the Posting Guidelines!!!
also, i gave username and password for the host. again, i got another error...

"error in sending mail: The following From address failed: sxs@gmail.com "
Dec 27 '06 #3
4,258 Expert 4TB
Please read the Posting Guidelines before you post in this forum!, especially CODE.

Playing around with your code I found that I had the same error. But changing the SMTP server to a valid SMTP server did send the email.

So are you sure that this statement
Expand|Select|Wrap|Line Numbers
  1. $mail->Host="smtp.gmail.com";
is entirely correct?

Ronald :cool:
Dec 27 '06 #4

thanks for your reply..

also, i am sorry that i din noticed the guidlines before posting my forum.

wont continue in the future..
Dec 27 '06 #5
4,258 Expert 4TB
That's okay. But does your script work now?

Ronald :cool:
Dec 28 '06 #6
There is a problem in the host:smtp.gmail.com..i used swiftmailer to send mail..
because, gmail supports TLS support..but, when i run the code, i get the error:

"Connection to the given MTA failed. The Connection Interface said: Unable to find the socket transport "tls" - did you forget to enable it when you configured PHP?"

anybody know how to configure TLS in php5?
Dec 28 '06 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Robbie | last post: by
2 posts views Thread by Latha Rajeev | last post: by
3 posts views Thread by Charlie | last post: by
5 posts views Thread by JPS | last post: by
6 posts views Thread by Dave Kelly | last post: by
2 posts views Thread by jephperro | last post: by
7 posts views Thread by dlite922 | last post: by
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.