title: Delphi XE3 indy gmail smtp
body: <p>I have a problem sending gmail smtp mail with indy on delphi XE3 build (Version 17.0.4770.56661)</p>
  
  <p>I can smooth send my laptop but other pc's give a error like "connection closed gracefully"</p>
  
  <p>I add a idlogfile component on my form and give me this line</p>
  
  <pre><code>Recv 18.04.2013 11:17:20: 220 mx.google.com ESMTP s47sm13947715eeg.8 - gsmtp&lt;EOL&gt;
  Sent 18.04.2013 11:17:20: EHLO S23-101&lt;EOL&gt;
  Recv 18.04.2013 11:17:20: 250-mx.google.com at your service, [195.175.87.XX]&lt;EOL&gt;250-SIZE 35882577&lt;EOL&gt;250-8BITMIME&lt;EOL&gt;250-STARTTLS&lt;EOL&gt;250 ENHANCEDSTATUSCODES&lt;EOL&gt;
  Sent 18.04.2013 11:17:20: STARTTLS&lt;EOL&gt;
  Recv 18.04.2013 11:17:21: 220 2.0.0 Ready to start TLS&lt;EOL&gt;
  Sent 18.04.2013 11:17:21: QUIT&lt;EOL&gt;
  </code></pre>
  
  <p>And I use this code on my app </p>
  
  <pre><code>IdSMTP1.host:='smtp.gmail.com'  ;
      IdSMTP1.username:='umutscada@gmail.com';
      IdSMTP1.Password:='XXXX';
      IdSMTP1.port:=587;
      IdSMTP1.UseTLS:=utUseExplicitTLS;
      IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Mode := sslmClient;
      IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method:= sslvTLSv1;
      IdSSLIOHandlerSocketOpenSSL1.SSLOptions.VerifyDepth := 2;
      IdSSLIOHandlerSocketOpenSSL1.SSLOptions.VerifyMode := [];
      IdSSLIOHandlerSocketOpenSSL1.Host := IdSMTP1.Host;
      IdSSLIOHandlerSocketOpenSSL1.Port := IdSMTP1.Port;
  
      IdMessage1.From.address := 'umutscada@gmail.com';
      IdMessage1.CClist.EMailAddresses:= edit5.Text;
      IdMessage1.Subject:= 'Subject is here';
      IdMessage1.Body.Clear;
      Idmessage1.Body.Add('Body is here');
      for Z := 0 to ListBox8.Items.Count-1 do begin
        TIdAttachmentFile.Create(IdMessage1.MessageParts,ListBox8.Items[Z]);
      end;
      IdSMTP1.Connect;
      IdSMTP1.Authenticate;
      try
          try
              idSMTP1.Send(IdMessage1);
          except on E:Exception do
              Memo1.Lines.Insert(0, 'ERROR: ' + E.Message);
          end;
      finally
          if idSMTP1.Connected then idSMTP1.Disconnect;
      end;
  </code></pre>
  
  <p>Please help me </p>
  
  <p>Thanks :)</p>