Sending Email Messages Error

Hi All

I have a simple application that sends emails which I got from http://delphi.about.com/od/indy/a/email-send-indy.htm 

This works fine on my pc when in Delphi XE2 environment and also when I run the .exe on my pc.

When running the .exe on other pcs on the network (that have email and network capabilities) I get a error message:-

"ERROR: Service not available

Status: Disconnected.
Status: Disconnecting.
Status: Connected.
Status: Connecting to 192.168.1.1.
Status: Resolving hostname Serv-mail01.Serv.local."

I've run as Admin and still the same error.

Any Ideas why or what I need to check?

tia
0
Andrew
7/22/2015 8:07:34 AM
embarcadero.delphi.winsock 1874 articles. 2 followers. Follow

9 Replies
294 Views

Similar Articles

[PageSpeed] 57

Andrew wrote:

> I have a simple application that sends emails which I got from
> http://delphi.about.com/od/indy/a/email-send-indy.htm

That example is for Indy 9.  I assume you are using Indy 10 instead, is that 
right?

> Any Ideas why or what I need to check?

There is not enough information to diagnose your problem.  Is an exception 
being raised by TIdSMTP.Connect() or TIdSMTP.Send()?  If so, what class type 
does it have, and what does its Message property say?  The fact that you 
are able to connect and then get disconnected suggests that the server is 
likely sending an error message in reply to a command, or even in the initial 
greeting.  But since you have not shown the actual SMTP communication log 
(to get that, use a packet sniffer, or attach a TIdLog... component to TIdSMTP) 
to see what the actual commands and responses look like.

-- 
Remy Lebeau (TeamB)
0
Remy
7/22/2015 7:38:50 PM
I would suspect that the other PCs do not have the OpenSSL dlls
on thier systems each is named as 
libeay32.dll 
and 
ssleay32.dll 
you need to export these two dlls along with your application
0
Dennis
7/23/2015 2:50:02 PM
Hi Remy


> That example is for Indy 9.  I assume you are using Indy 10 instead, is that right?

I'm using Indy version 10.5.8.0

 
> There is not enough information to diagnose your problem.  Is an exception 
> being raised by TIdSMTP.Connect() or TIdSMTP.Send()?  If so, what class type 
> does it have, and what does its Message property say?  The fact that you 
> are able to connect and then get disconnected suggests that the server is 
> likely sending an error message in reply to a command, or even in the initial 
> greeting.  But since you have not shown the actual SMTP communication log 
> (to get that, use a packet sniffer, or attach a TIdLog... component to TIdSMTP) 
> to see what the actual commands and responses look like.

These are the components I'm using from Indy:-
    MailMessage: TIdMessage;
    SMTP: TIdSMTP;


Exception is being raised on the Connection as I wrapped a try except around:-

  //send mail
  try
    try
      SMTP.Connect;
      try
        SMTP.Send(MailMessage);
      except on E:Exception do
        StatusMemo.Lines.Add(' Sending ERROR: ' + E.Message);
      end;
    except on E:Exception do
      StatusMemo.Lines.Add('Connection ERROR : ' + E.Message);
    end;
  finally
    if SMTP.Connected then SMTP.Disconnect;
  end;




Which doesn't make sense as the SMTP component has a "Status Event" and that display the following  messages:-
Status: Disconnected.
Status: Disconnecting.
Status: Connected.
Status: Connecting to 192.168.1.1.
Status: Resolving hostname Serv-mail01.Serv.local.


One of which was "Connected"



Strange.
0
Andrew
7/23/2015 3:25:04 PM
Andrew wrote:

> I'm using Indy version 10.5.8.0

> These are the components I'm using from Indy:-

Please attach one of the TIdLog... components, such as TIdLogFile, to the 
TIdSMTP.Intercept property, and then provide the resulting log here.

> Exception is being raised on the Connection as I wrapped a try except
> around:-

But what does the exception actually say?  Without that, I cannot tell you 
what is going wrong.

> Which doesn't make sense as the SMTP component has a "Status Event"
> and that display the following  messages:-
> 
> Status: Disconnected.
> Status: Disconnecting.
> Status: Connected.
> Status: Connecting to 192.168.1.1.
> Status: Resolving hostname Serv-mail01.Serv.local.
> 
> One of which was "Connected"

That simply means the underlying socket has successfully connected to a listening 
port on the server.  That event occurs before any data is then exchanged 
over the socket.  You are getting disconnected after the event is triggered, 
because something is going wrong.  Either the server is disconnecting you 
with an error message, or an SMTP command is failing.

-- 
Remy Lebeau (TeamB)
0
Remy
7/23/2015 6:06:35 PM
Dennis wrote:

> I would suspect that the other PCs do not have the OpenSSL
> dlls on thier systems each is named as
> libeay32.dll
> and
> ssleay32.dll
> you need to export these two dlls along with your application

Assuming the app is trying to use SSL/TLS to begin with.  The example Andrew 
is basing his code on does not use SSL/TLS.

If SSL/TLS were being used, and if the DLLs are missing, or the wrong version 
of the DLLs are being used, or Indy's SSL/TLS properties are misconfigured, 
that would certain cause TIdSMTP failures.

-- 
Remy Lebeau (TeamB)
0
Remy
7/23/2015 6:10:04 PM
Hi Remy

> Please attach one of the TIdLog... components, such as TIdLogFile, to the 
> TIdSMTP.Intercept property, and then provide the resulting log here.

I've attached a 

IdLogFile1: TIdLogFile;

On the Failed PC's (3 I've tried all with Outlook 2010 connection capabilities) it only generated:-

Stat Connected.
Recv 24/07/2015 09:45:17: 421 4.3.2 Service not available<EOL>
Stat Disconnected.

On my PC it Generates:-

Stat Connected.
Recv 24/07/2015 09:39:08: 220 Serv-mail01.Serv.local Microsoft ESMTP MAIL Service ready at Fri, 24 Jul 2015 09:39:22 +0100<EOL>
Sent 24/07/2015 09:39:08: EHLO AndrewPailthorp<EOL>
Recv 24/07/2015 09:39:08: 250-Serv-mail01.Serv.local Hello [192.168.7.89]<EOL>250-SIZE 15728640<EOL>250-PIPELINING<EOL>250-DSN<EOL>250-ENHANCEDSTATUSCODES<EOL>250-STARTTLS<EOL>250-AUTH<EOL>250-8BITMIME<EOL>250-BINARYMIME<EOL>250-CHUNKING<EOL>250-XEXCH50<EOL>250 XSHADOW<EOL>
Sent 24/07/2015 09:39:08: RSET<EOL>
Recv 24/07/2015 09:39:08: 250 2.0.0 Resetting<EOL>
Sent 24/07/2015 09:39:08: MAIL FROM: <firstname.lastname@email.co.uk><EOL>
Recv 24/07/2015 09:39:08: 250 2.1.0 Sender OK<EOL>
Sent 24/07/2015 09:39:08: RCPT TO:<firstname.lastname@email.co.uk><EOL>
Recv 24/07/2015 09:39:08: 250 2.1.5 Recipient OK<EOL>
Sent 24/07/2015 09:39:08: DATA<EOL>
Recv 24/07/2015 09:39:08: 354 Start mail input; end with <CRLF>.<CRLF><EOL>
Sent 24/07/2015 09:39:08: From: "firstname.lastname@email.co.uk" <firstname.lastname@email.co.uk><EOL>Subject: This is the subject of this mail<EOL>To: firstname.lastname@email.co.uk<EOL>Content-Type: text/plain; charset=us-ascii<EOL>MIME-Version: 1.0<EOL>Date: Fri, 24 Jul 2015 09:39:08 +0100<EOL>
Sent 24/07/2015 09:39:08: <EOL>
Sent 24/07/2015 09:39:08: Mail body goes here...<EOL>
Sent 24/07/2015 09:39:08: this is the NEW host name "192.168.66.2"  <EOL>
Sent 24/07/2015 09:39:08: this is the OLD host name "mala-mail.mala.local"<EOL>
Sent 24/07/2015 09:39:08: <EOL>
Sent 24/07/2015 09:39:08: .<EOL>
Recv 24/07/2015 09:39:08: 250 2.6.0 <619bf346-c117-4f70-8e7f-8f77c7ac89f4@Serv-mail01.Serv.local> [InternalId=539313] Queued mail for delivery<EOL>
Sent 24/07/2015 09:39:08: QUIT<EOL>
Recv 24/07/2015 09:39:08: 221 2.0.0 Service closing transmission channel<EOL>
Stat Disconnected.





> But what does the exception actually say?  Without that, I cannot tell you 
> what is going wrong.

  try
    try
      SMTP.Connect;
      try
        SMTP.Send(MailMessage);
      except on E:Exception do
        StatusMemo.Lines.Add(' Sending ERROR: ' + E.Message);
      end;
    except on E:Exception do
      StatusMemo.Lines.Add('Connection ERROR : ' + E.Message);
    end;
  finally
    if SMTP.Connected then SMTP.Disconnect;
  end;

The Exception Message is "Service not available"
0
Andrew
7/24/2015 9:36:48 AM
Hi Dennis

That's for the reply

> I would suspect that the other PCs do not have the OpenSSL dlls
> on thier systems each is named as 
> libeay32.dll 
> and 
> ssleay32.dll 
> you need to export these two dlls along with your application

I included both dll's with the .exe and this still produced the same result "Service not available" 

I ran the .exe as an administrator with the same results as above.
0
Andrew
7/24/2015 9:46:49 AM
Hi Dennis

Thanks for the reply

> I would suspect that the other PCs do not have the OpenSSL dlls
> on thier systems each is named as 
> libeay32.dll 
> and 
> ssleay32.dll 
> you need to export these two dlls along with your application

I included both dll's with the .exe and this still produced the same result "Service not available" 

I ran the .exe as an administrator with the same results as above.
0
Andrew
7/24/2015 9:56:02 AM
Andrew wrote:

> On the Failed PC's (3 I've tried all with Outlook 2010 connection
> capabilities) it only generated:-
> 
> Stat Connected.
> Recv 24/07/2015 09:45:17: 421 4.3.2 Service not available<EOL>
> Stat Disconnected.

That is an error message coming from the SMTP server itself as its initial 
greeting.  The server is rejecting the connection at that moment.  There 
is nothing you can do about that in your code.  Move on and try again later.

-- 
Remy Lebeau (TeamB)
0
Remy
7/24/2015 4:59:31 PM
Reply:

Similar Artilces:

Error message sending an email
This is a multi-part message in MIME format. ------=_NextPart_000_0000_01C62274.7EE67120 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, I am new to the bugzilla system and this is probably a trivial setup question. I've installed bugzilla on Windows 2003 Server with Apache running on it. I also have IIS running on the same machine for other purposes, but it's not used by bugzilla. I followed the step by step instructions at this site: http://www.bugzilla.org/docs/win32install.html I am able to access bugzilla an...

error message when sending an email
Hello. I'm trying to send an email from one acocunt to another to test but I'm getting this error. The connection to the server has failed. Account: 'mail.MyName.org', Server: 'mail.MyName.org', Protocol: SMTP, Port: 25, Secure(SSL): No, Socket Error: 10060, Error Number: 0x800CCC0E I I understand the error message but how do I get rid of the socket error? I'm using outlook express 6 and windows xpsp2 to do this. Thanks. "marrie" <SA@mailinator.com> wrote in message news:el78e3$m5f$1@news.grc.com... > Hello. I'm trying to s...

Sending Email Messages Error #2
Hi All I have a simple application that sends emails which I got from http://delphi.about.com/od/indy/a/email-send-indy.htm This works fine on my pc when in Delphi XE2 environment and also when I run the .exe on my pc. When running the .exe on other pcs on the network (that have email and network capabilities) I get a error message:- "ERROR: Service not available Status: Disconnected. Status: Disconnecting. Status: Connected. Status: Connecting to 192.168.1.1. Status: Resolving hostname Serv-mail01.Serv.local." I've run as Admin and still the same error. ...

error message when sending email through Gmail
I got the following error message when I tried to send email through gmail: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond I know the following code is correct because many people use the same code and it works.  I set the POP enabled in the gmail account.  Can anybody tell me what has caused this error?  Thanks in advance.Dim mail As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage() mail.To.Add("aFriend@gmail.com"...

Error message when I try to send an email
I'm getting this error message when I try to send an email: ---------------------------------------------------------------------- The "SendUsing" configuration value is invalid. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: The "SendUsing" configuration value is invalid. Source Error: Line 48: Line 49: SmtpMail.Send(txtFrom.Te...

Error while sending message to one email address
This is what I see on GWIA when I try to send message to xxxxxx@xxxxxx.net > │ GroupWise 5.2 Internet Agent > ---------------------------------------------------------- > │07:02:28 0 Detected error on SMTP command > │07:02:28 0 Command: HELO archatl.com > │07:02:28 0 Response: 551 Verification of sending machine failed: no mail > │ will be accepted > │07:02:28 0 Building undeliverable message ...

CDO.Message fails to send email with no errors
I have had the same information form on my site for 2 years and it has always worked fine but suddenly I do not receive emails anymore.  There are no errors and the rest of the form works fine.  Once the user fills out the form it shows them a presentation.  That still works.  I thought maybe my email address was getting blocked due to spam but I tried various other email addresses, even those with different hosts, still no emails get sent.  My website is hosted by Network Solutions.  I called them and asked them if they updated their servers or made any other c...

error message when sending email through gmail #2
i got the error message when i tried to send email through gmail:   The operation has timed out. The operation has timed out. this is my code:Dim mail As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage() mail.To.Add("aFriend@gmail.com")mail.Subject = "automatically sent email " mail.From = New System.Net.Mail.MailAddress("myAccount@gmail.com") mail.Body = "If you receive this email, it means you don't need your own email server to send email through internet. You may use gmail server. This message has b...

Error trying to send email
Thanks for taking the time to read my post. :-) I'm having a problem sending an email message. I keep getting an error "Could not access 'CDO.Message' object." After looking at the help for Smtp.Send it looks like this is a data error but I've tried to call both send routines, one with a MailMessage object and one with all the text strings. Here's the code I wrote: string strBody = ""; MailMessage BidRequest = new MailMessage(); foreach (string s in Request.Form.AllKeys) { if ((s == "__VIEWSTATE") || (s == "Button1")) ...

error when i send email to new user(welcoime message)
 hi..when i add my users to the site and send them the welcome message i get this error The user or users have been added successfully, but there was an error in sending the e-mail message. The server may not be set up correctly to send e-mail. To verify that e-mail is configured correctly, contact your server administrator.   i ve properly given then settings in central admin and site admin...wat might be de prob for it ----Jai---------http://www.jayaraja.comhttp://blog.jayaraja.com Can you post the configuration details? Regards,PrashantDont forge...

Error message: sending of message failed
Hi all.. WHen I try to send email, I get the following message? Sending of message failed. Error writing temporary file. This is my first time trying to send messages. I have windows vista home basic edition. Can you please help me? Yours truly Casper. Casper said the following On 03/01/2008 10:28 AM: > Hi all.. > > WHen I try to send email, I get the following message? > > Sending of message failed. > Error writing temporary file. > > This is my first time trying to send messages. > I have windows vista home basic edition. > &g...

Sending Email Messages Error (Duplicated Thread. Please remove) [Edit]
Hi All I have a simple application that sends emails which I got from http://delphi.about.com/od/indy/a/email-send-indy.htm This works fine on my pc when in Delphi XE2 environment and also when I run the .exe on my pc. When running the .exe on other pcs on the network (that have email and network capabilities) I get a error message:- "ERROR: Service not available Status: Disconnected. Status: Disconnecting. Status: Connected. Status: Connecting to 192.168.1.1. Status: Resolving hostname Serv-mail01.Serv.local." I've run as Admin and still the same error. ...

CreateUserWizard fails to send email with a great non-helpful error message
Hello. Trying to use the ASP.net user functionality but it keeps failing on me. I have created a login and registration page for my site. When you fill in the registration form it should send a confirmation email with a link to activate the account. Nothing hi-tech here. However, it fails to send the email and provides the following error message: Code: ( text ) Transaction failed. The server response was: sorry, the sender name and auth login doesn't coincide (#5.7.1) Description: An unhandled exception occurred during the execution of the current web request. Please review ...

Sending email, but get the error : could not access "CDO.Message" object
Hi, I use .NET component to write an email sending component. I set the SmtpServer to an internet SMTP server which is used in my outlook express. When I send the email, I got the following error: could not access "CDO.Message" object what is the reason? How to solve? Thank you in advance. You are most likely not authenticating to the SMTP server....

Web resources about - Sending Email Messages Error - embarcadero.delphi.winsock

Message - Wikipedia, the free encyclopedia
A message is a discrete unit of communication intended by the source for consumption by some recipient or group of recipients. A message may ...

Catholic school strike: Out-of-office message out of order
Catholic teachers banned from making statement in email reply.

Catholic school strike: Out-of-office message out of order
Catholic teachers banned from making statement in email reply.

Trudeau's World Economic Forum Message: Canada's Open For Business 181
The PM also pointed to the success of a Canadian university.

You have a Jack lets you decide when messages can be opened
You know the anticipation of waiting to open holiday gifts? You see them tagged with your name and wonder what is inside. It can be very exciting, ...

This quirky voicemail message hints at the kind of future that Facebook is drooling for
After six rings, photographer Michael Anderson's voicemail clicks on, blasting an unusual message to his callers: "This is what I want you to ...

Minn. cop on leave over message on Black Lives Matter
Social media message alleged to be from St. Paul cop about protesters tells public to "run them over"

The market's economic message
Should you listen to the message that stocks appear to be sending about the state of the economy, or not?

Carolina Panthers Player Has A Vulgar Message For Seattle Seahawks Fans
Carolina Panthers Player Has A Vulgar Message For Seattle Seahawks Fans

Republicans are trying to help Bernie Sanders win, and it's not because they like his message
Sen. Claire McCaskill, facing difficult re-election prospects in 2012 as a Democrat running in Missouri, made a daring gamble: She bought millions ...

Resources last updated: 1/22/2016 5:07:46 AM