Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Feb : Internal Application Error

www.cryer.info
Managed Newsgroup Archive

Internal Application Error

Subject:Internal Application Error
Posted by:"mark horrocks" (markhorroc..@yahoo.com)
Date:Tue, 5 Feb 2008 21:34:12

I am using Indy 10 and D7 to make an email client in an ISAPI.

The app works fine, emails get sent Ok as expected, but the Response is
never sent back, just a message that says Internal Application Error.

Any ideas as to why this is? The ISAPI is compiled with FastMM4.

Here is the code.

var
  WebModule1: TWebModule1;

implementation

uses Webreq;

{$R *.dfm}

procedure TWebModule1.WebModule1waSendMailAction(Sender: TObject;
  Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin

  idSMTP.Host := 'mail.sportdata.com.au';

  idSMTP.Port := 25; //smtp service usually runs on this port

// idSMTP.Password:= '';

  idmessage.From.address:= Request.ContentFields.Values['FromAddress'];

  idmessage.Recipients.EMailAddresses:=
Request.ContentFields.Values['FromAddress'];

  idmessage.BccList.EMailAddresses :=
Request.ContentFields.Values['EmailAddresses'];

  idmessage.Subject := Request.ContentFields.Values['Subject'];

  idmessage.Body.Text := '<html><head></head><body>' + '<p>' +
         Request.ContentFields.Values['AdditionalMessage'] +
         Request.ContentFields.Values['BodyText'] +
         '</body></html>';

  idmessage.ContentType := 'text/html';

  Response.Content := '<html><head></head><body><p>Emails sent
successfully!</body></html>';

  try
      idSMTP.Connect;
      idSMTP.send(idmessage);

  finally

    //disconnect from server
    if IdSMTP.Connected then
      IdSMTP.Disconnect;

  end;
end;

Initialization
  if WebRequestHandler <> nil then
    WebRequestHandler.WebModuleClass := TWebModule1;

end.

Mark Horrocks

Replies:

www.cryer.info
Managed Newsgroup Archive