Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Delphi
The following is a very basic email program program I wrote using Delph 7.
The program bombs out when executing
SMTP.Send(Email);

The message is Exception EldProtocolReplyError in Module SendEmail.exe at 00025AB4.
5.7.0 Must issue a STARTTLS command first. co1sm11098818vdc.10

 

program SendEmail;
 
{$APPTYPE CONSOLE}
 
uses
  SysUtils,IdSMTP,IdMessage;
 
 Var
  SMTP        : TIdSMTP;
  Email: TIdMessage;
 
begin
SMTP := TIdSMTP.Create(nil);
Email := TIdMessage.Create(nil);
try
SMTP.Host  := 'smtp.gmail.com';
SMTP.Port := 25;
SMTP.Username := 'username';
SMTP.Password := 'password';
Email.From.Address := 'steven@gmail.com';
Email.Recipients.EMailAddresses := 'steven@gmail.com';
Email.Subject := 'system message';
Email.Body.Text := 'Hello, It is Just for test';
SMTP.Connect;
 
// This is where the Exception occurs
SMTP.Send(Email);
 
finally
SMTP.Free;
Email.Free;
end;
 
readln;
end.
 
Please advice me what I need to do to make this program run.
 
Thank you
Posted 6-Nov-12 12:33pm
Comments
ryanb31 at 8-Nov-12 11:45am
   
I don't do Delphi but since no one has answered you have you looked at the error? It's indicating some setup of the connection is not getting called.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 315
1 OriginalGriff 273
2 Aajmot Sk 224
3 Marcin Kozub 210
4 Richard MacCutchan 200
0 OriginalGriff 7,853
1 Sergey Alexandrovich Kryukov 7,107
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,790


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 6 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100