Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

EidSMTPReplyError

edited September 2010 in General
Hello

RBuilder 11.08, Windows 7 and Delphi 2010

I am using the RBuiler Wiki example code to capture Email errors and Indy10
to send email.

uses
ppEmail,
ppSMTPIndy10,
idSSLopenSSLl,
idReplySMTP;

procedure TRBReportRequestLetter.FormCreate(Sender: TObjecct);
begin
with ppReport1 do
begin
TppEmail(ppReport1.Email).SMTP.OnEmailError := EmailErrorEvent;
end;
end;

procedure TRBReportRequestLetter.EmailErrorEvent(Sender: TObject;
aErrorText: String);
begin
showmessage(aErrorText);
end

The problem is that I am trying to capture EIdSMTPReplyError exception class
messages that would display for example if the email recipent's domain was
incorrect. These messages do not display in the EmailErrorEvent but they do
display in the debugger exception notification window when the program is
run inside the Delphi IDE. They also do not display inside a try-except
block surrounding the SendEmail command. Finally, I have been unable to
capture the text messages inside the EmailErrorEvent with any permutations
of code using TidReplySMTP, such as
TidReplySMTP(ppReport1.Email).Text.CommaText.

Could anyone illustrate how to capture the EIdSMTPReplyError messages?

TIA

John

Comments

  • edited September 2010
    There is a patch available for RB 12.01 that improves the error notification
    of the Indy plugin. Send an email to support@digital-metaphors.com if you
    would like the patch.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2010
    Nico

    If there is a patch in 12, I will simply upgrade. If I do so, do I still
    use the EMailError event discussed in my initial post or does
    EIdSMTPReplyError require a different event handler?

    TIA

    John

  • edited September 2010
    Hi John,

    You can use the EmailError event that is used in the RBWiki example. It
    will now display the exception message instead of the last command result
    which was not giving the correct results.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.