473,395 Members | 1,681 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 20957
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

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

Similar topics

0
by: Robbie | last post by:
Hi, I have a strange error occuring - I don't think its a code issue - but maybe someone here has run into this before. I have some code to send an Email using the System.Web.Mail message...
2
by: Latha Rajeev | last post by:
Hi, I have an application which sends out mails(using CDO), the SMTP Server being a machine which is one the same network. Most times, the mails are sent out successfully but every once in a...
3
by: Charlie | last post by:
Hi: Using the sMTP class and my ISP as smtp server, I sometimes get the following message: "The message could not be sent to the SMTP server. The transport error code was 0x800ccc60. The...
5
by: JPS | last post by:
I seem to have everything setup correctly but when I send a messge I get this. The problem is: Could not access 'CDO.Message' object.
1
by: Hennie7863 | last post by:
Hi all, At this moment I'm trying to get database mail working. According to some people it should be easy. Well...that is not the case for me. I'm having the following error: The mail could...
0
by: Homer | last post by:
Hi, I got "InnerException: Unable to connect to remote server"..."No connection could be made because the target machine actively refused it" when I attempted to send an email through my...
6
by: Dave Kelly | last post by:
Sorry for the long post, it is easier to discard information than to have to wait for it to arrive. So here goes: This code worked perfectly when I was an Earthlink customer. Sprint decided...
2
by: jephperro | last post by:
Hi there, I have a problem using PHPMailer. On my local development machine, the script works fine and sends emails. On amy staging server, when I try to use PHPMailer to send() I see the...
7
dlite922
by: dlite922 | last post by:
I can't seem to get it working with my smtp server. I can send the email through the command line like so: 220 localhost.localdomain ESMTP Sendmail 8.13.8/8.13.8; Wed, 6 Aug 2008 18:44:29...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.