Moving from Indy 9 to Indy 10 - question about code change

I tried posting this to the Atozed forums, but the post isn't going thru. 
So trying here...

In our D7 mail app, this was our code when using Indy 9 to send emails 
(FEmail is TIdSMTP):

  FMail.AuthenticationType := atNone;
  FMail.Connect;
  try
    if FMail.AuthSchemesSupported.IndexOf('LOGIN') > -1 then
    begin
      FMail.AuthenticationType := atLogin;
      try
        FMail.Authenticate;
      except
        on E: Exception do
         begin
          try
            FMail.AuthenticationType := atNone;
            FMail.Authenticate;
          except
            on E: Exception do
            begin
              //log the exception
            end;
          end;
        end;
      end;

      if not FMail.Connected then
      begin
        //log failure
        Exit;
      end;
    end;

    try
      FMail.Send(FMsg);
    except
      //log the exception
    end;
  finally
    FMail.Disconnect;
  end;

With Indy 10, we don't need to check for the 'LOGIN' authentication schemes 
ourselves anymore, do we?  I changed the code to this:

  FMail.AuthType := satDefault;
  try
    try
      FMail.Connect;
    except
      on E:Exception do
        begin
          //Log the exception
          Exit;
        end;
    end;

    try
      FMail.Send(FMsg);
    except
      on E:Exception do
        begin
          //Log the exception
          Exit;
        end;
    end;
  finally
    if FMail.Connected then
      FMail.Disconnect;
  end;


Everyting seems to work fine in my testing.  I assume AuthType of satDefault 
handles the check for 'LOGIN', from what I could see in the Indy code.  Is 
my assumption correct and does this look like a valid change?

Thanks,
Jon.
0
Jon
9/15/2009 5:54:21 PM
embarcadero.delphi.tools 5366 articles. 3 followers. Follow

2 Replies
1025 Views

Similar Articles

[PageSpeed] 49
Get it on Google Play
Get it on Apple App Store

"Jon Scott" <nospam@server.com> wrote in message 
news:162549@forums.codegear.com...

> I tried posting this to the Atozed forums, but the post isn't going thru.

Yes, it did, and I already answered it there.

> With Indy 10, we don't need to check for the 'LOGIN' authentication
> schemes ourselves anymore, do we?

No.  Setting AuthType to satDefault (Indy 10's equivilent of Indy 9's 
atLogin) does that check internally.

> Everyting seems to work fine in my testing.  I assume AuthType of 
> satDefault handles the check for 'LOGIN'

Yes.

-- 
Remy Lebeau (TeamB)
0
Remy
9/17/2009 11:35:19 PM
"Remy Lebeau (TeamB)" wrote...
>
> Yes, it did, and I already answered it there.


Yes, the post finally made it thru and I read the answers there.  Thanks for
responding.

Jon.
0
Jon
9/18/2009 5:44:50 PM
Reply:

Similar Artilces:

delphi 7 Indy 9 and Indy 10
Hi, I can upgrade to indy 10 in delphi 7. But I have discover that indy 9 and Indy 10 have some different properties, so i had to change my old programs that were made in indy 9 to upgrade it to new version, but it is a long work. So I want to know if it is possible to install in the same delphi 7 both versions indy 10 and indy 9. I have tried to do it but i received a error message: Cannot load package 'IndySystem70'. It contains unit 'IdWinSock2', which is also contained in package 'Indy70'. Some can give me ideas or a link to read how to install both versi...

Converting Delphi 2007 Indy 10.2.3 to Delphi 2009 Indy 10.5.5 [Edit]
Hello, I am currently attempting to port over a Delphi 2007 project that uses Indy 10.2.3 (very successfully) to Delphi 2009 and Indy 10.5.5 (I just got the latest development build this morning). I think I am running into an encoding issue, but am not sure. Specifically, IDHTTP with SSL calls an old CGI and the CGI returns a .zip file and I then save it to the disk. In 2007 and before this worked perfectly. In 2009, it is not. Here is the examples of the 2 different results (though cut way short in the post) I am getting back: 2007: 'PK'#3#4#$14#0#0#0#8#0'rLQ9žrPb€'#0...

migrating from Delphi 6 With Indy 10 to XE7 with Indy 10
I updated the original Indy in D6 to version 10 several years ago. Now I want to migrate my application from D6 to XE7 and would like some feedback on the best route to take. I usually send data using readln and writeln statements. The data is typically XML format. Since migrating to XE7 will include potential unicode data what is the best approach to take when reading and writing data? Will writeln and readln work in these cases or should I be using a different strategy to send unicode data between the tidtcpclient and tidtcpserver applications? al wrote: > I usually send data ...

indy 10 back to indy 9
Can anyone point me in the right direction on how to uninstall Indy 10 and go back to Indy 9? I have a Delphi 2007 project that was apparently done with Indy 9 ...

Is Indy 9 more estable than Indy 10?
Using Delphi 2009 update 3 and the latest snapshot indy(tiburon). I am porting app from Indy 9 to Indy 10, the app use a TIdMappedPortTCP component with SSL. This is my app configuration using webservices. Client -> TIdMappedPortTCP and SSL -> IIS Server with webservice app. The client app uses a method on the webservice that returns a TByteDynArray that contains a zipped file. This works with no problem with Indy 9, but when ported to Indy 10,the data transfer between the webservice and the client application with some zip files does no get completed, the client a...

Migrating from Indy 9 to Indy 10
Hi... At work I had to update an old project and it is socket related. It was written with indy 9 and now all I have is Indy 10. I could install indy 9 but I'd rather make it work with I10. The problem is: In the server side there's a lot of: AThread.Connection.WriteInteger(1); AThread.Connection.WriteBuffer(XX, XX); AThread.Connection.ReadStream(XX, XX, XX); idTCPClient is widely used like this: TCPClient.WriteBuffer(Msg, sizeof(TMensaje)); TCPClient.ReadBuffer(Rta, sizeof(TRespuesta)); TCPClient.WriteStream(fStream); TCPClie...

indy 9 ---> indy 10 cpu
I use delphi 5, indy 9.0.50 and indy 10_4806 I have used indy 10 in my some projects before. And I decided to covert my indy 9 server program to indy 10. Same code and same system but indy 10 uses alot of cpu if the connection count is greater than 200 indy 9 Server : 900 connections - cpu usage: %0 indy 10 server: 500 connections - cpu usage: %30 I only change below codes: - Server.ThreadClass := TMypeerthread ---> Server.ContextClass := TMypeerthread - TMyPeerThread = class(TIdPeerThread) ----> TMyPeerThread = class(TIdServerContext) - constructor TMyPeerThread...

Is it possible to install indy 9 and indy 10 at the same time?
Is it possible to install indy 9 and indy 10 at the same time with a Delphi compiler? Thanks. <joshua lim> wrote in message news:226196@forums.embarcadero.com... > Is it possible to install indy 9 and indy 10 at the same time with a > Delphi compiler? It is technically possible, but it is not easy to set up, and requires manual work to switch between them when needed. -- Remy Lebeau (TeamB) Thanks Remy, are you referring to this? http://www.indyproject.org/KB/howdoiinstallindyd.htm I'm sure many of us face the issue of having some projects in Indy 9 ...

Indy 10 -> Indy 9 TCPClient communication
I have my program happily running in Delphi 2007 with Indy 10, but now I have to do the same program in Delphi 7 with Indy 9. I can't seem to figure out how to read the responses correctly. Here's the Indy 10 code: procedure TfmSimpleTest.Timer1Timer(Sender: TObject); var inBuffer1 : TIDBYtes; intlen : integer; REsponse : boolean; begin if not assigned(TCPClient.IOHandler) then exit; if TCPCLient.IOHandler.INputBufferIsEmpty then begin TCPClient.IOhandler.CheckforDataOnsource(10); while TCPClient.IOHandler.INputbuffer.size >= 2 do begi...

How to convert app from Indy 9 to Indy 10 using Delphi7
I have a small app I have been using a lot, which is a mailchecker where I have used Indy components to handle the POP3 access to mailservers. It was last built in 2004. Now I need to add the possibility to change the POP port for certain non-standard servers. So I opened the project in Delphi7 and immediately received component exceptions.... After ignoring these and changing my package load info for the project to use the Indy that was delivered with Delphi7 I thought all was well since the app now built without errors, but at runtime it caused an exception inside the Forms unit! ...

Indy E-Mail Problem (Indy 10, Delphi 2007)
Hello, we use Indy 10 with Delphi 2007 to get E-Mail using IMAP. We recieved an E-Mail which is not handled correctly. The E-Mail looks like this {code} Return-Path: <test@mail.com>; From: "Test Tester" <test@mail.com>; To: <test@mail.com>; Subject: Order Date: Wed, 7 Mar 2012 16:50:40 +0100 Message-ID: <15D526BEB8091D43859549D9E16E370FBA3123> MIME-Version: 1.0 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQFk6K6fcF3...

Indy 9 to Indy 10 Conversion
Good morning, I have a Client / Server in Indy 9. On Client connect event, I have the next code: ----------------------------------------------------------------------------------- 1. Connection.Write('1'); 2. c := Connection.ReadChar; 3. Connection.Write('3'); 4. c := Connection.ReadChar; 5. Connection.Write('5'); -------------------------------------------------------------------------------- On Server connect event, I have the next code: ----------------------------------------------------------------------------------- 1. c := Connect...

Indy 9 TIdTCPClient and Indy 10.5 TIdTCPServer
Hello, My application is multitiered and has a frontend that installs on a customer's machine and backends which run on our servers. There is a requirement that the legacy frontends compiled with Indy 9 be able to communicate with the new backends compiled with Indy 10.5. Are there any known problems with having Indy 9 TIdTCPClients communicate with Indy 10.5 TIdTCPServers? If so, are there any known workarounds? In particular, is there some limitation in passing TMemoryStreams between two different Indy vers ions? Thanks, Erzsebet Edited by: Erzsebet Carmean on Feb 22, 201...

Indy 9/10
I have been using Indy 9 and have been saving the message to a database using: IdMsgSend.SaveToStream(MyStream); Will Indy 10 read this? Brent brent wrote: > I have been using Indy 9 and have been saving the message to a > database using: > > IdMsgSend.SaveToStream(MyStream); > > Will Indy 10 read this? Yes. -- Remy Lebeau (TeamB) ...

Why does Delphi change Indy's dpk source file when I change project options [Edit]
Good day I have noticed that Delphi changes dpk source files for packages after I have changed something in that package's Project Options and in Indy's case it does it incorrectly. Why is that. For example... I open IndySystem170.dpk (Indy 10.6.0.5155) inside Delphi XE3 and get the following DPK source: {code} package IndySystem170; {$R *.res} {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} {$ALIGN 8} {$ASSERTIONS ON} {$BOOLEVAL OFF} {$DEBUGINFO ON} {$EXTENDEDSYNTAX ON} {$IMPORTEDDATA ON} {$IOCHECKS ON} {$LOCALSYMBOLS ON} {$LONGSTRINGS ON} {...

Web resources about - Moving from Indy 9 to Indy 10 - question about code change - embarcadero.delphi.tools

German question - Wikipedia, the free encyclopedia
"Kleindeutschland" redirects here. For the neighborhood in New York City, see Little Germany, Manhattan . 1820 map of Central Europe showing ...

New questions about San Bernardino shooters
The FBI says that the couple was radicalized and took target practice before the shooting. Melissa Chan reports.

Astronomers question claim of super planet found at solar system’s edge
The ALMA Telescope’s antennas are seen under a starry night sky. (credit: Christoph Malin) Scientists and amateur astronomers have long been ...

Question Of The Day: Most overlooked heroic engine?
Filed under: Etc. , Automotive History Some engines were made for decades and moved entire nations. Which one most deserves more recognition? ...

Media moral posing and the unasked Trump question
Media moral posing and the unasked Trump question by digby I wrote about Trump and the media today for Salon. Here's an excerpt in which I discuss ...

The question that Mark Zuckerberg inspires Facebook employees to ask themselves
Leaked messages from Mark Zuckerberg from the early days of Facebook portray the founder as a flippant jerk. But that image of yesterday's Zuckerberg ...

Report: Cruz questions Trump's "judgment" to be president
At a private fundraiser, Cruz remarked on Trump and Carson and their preparedness to be commander-in-chief, according to the New York Times

CEO Of Mainstream Renewable Power Questions Funding Decarbonization
Eddie O’Connor, the CEO of Mainstream Renewable Power, has called into question the need to financially support the decarbonization of economies ...

IDG Contributor Network: Stretch, tackle and question: One CTO's career advice
Dr. Darlene Solomon is chief technology officer for Agilent Technologies , advancing chemical and biological measurements in the life sciences, ...

How Answering A Simple Question Makes You An Easy Target For Identity Thieves
Think you're safe from identity theft? Think again. Answering just one simple question ("What's your Social Security Number?") can put you at ...

Resources last updated: 12/11/2015 6:35:22 PM