469,352 Members | 2,140 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,352 developers. It's quick & easy.

smtp error in phpmailer

4
hi

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,

sx216.
Dec 27 '06 #1
6 20726
ronverdonk
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
sx216
4
hi,

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;
  24.  
  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
ronverdonk
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";
  2.  
is entirely correct?

Ronald :cool:
Dec 27 '06 #4
sx216
4
hi,

thanks for your reply..

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

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

Ronald :cool:
Dec 28 '06 #6
sx216
4
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
dlite922
7 posts views Thread by dlite922 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.