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

Access to IdMessage in TppReport when sending mails

edited January 2014 in Devices
Hello,

I use successfully TppReport's SendMail to send emails.
But I need to change charset of a message body.
And there I couldn't find any way to get access to the message part of
the report. The question is in the code below.

uses ppSMTPIndy10;

var lEmail: TppEmail;
lIdMessage: TIdMessage;
with Rep do begin
TppEmail(Email).SMTP.OnEmailError := EmailErrorEvent;
TppEmail(Email).SMTP.OnStatusChange := EmailStatusChangeEvent;

TppSMTPPlugIn.RegisterClass(TppSMTPIndy);
EmailSettings.Recipients.Clear;
EmailSettings.Recipients.Add('somemail@mail.com');
EmailSettings.Body.Text:= 'Body text';

lEmail := TppEmail(Email);
TppSMTPIndy(lEmail.SMTP).IndySMTP.AuthType:= satNone;

// lIdMessage:= - what should be here ?
// lIdMessage.CharSet:= 'Windows-1251';

SendMail;
end;


Thanks in advance,
Nicos

Comments

  • edited January 2014
    Hi Nicos,

    You can access the TIdMessage object using the IndyMessage property.

    lIdMessage := TppSMTPIndy(lEmail.SMTP).IndyMessage;

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2014
    Thank you, Nico

    Unfortunatelly I can't find this property - IndyMessage
    There is only IndySMTP

    I use Delphi 2010, RB 11.07 and ppSMTPIndy10 in uses list

    Regards,
    Nicos

    On Mon, 27 Jan 2014 08:41:38 -0700, "Nico Cizik (Digital Metaphors)"
  • edited January 2014
    Hi Nicos,

    This property was added for a later version of ReportBuilder. Moving
    forward we hope you will consider upgrading to the latest version to
    take advantage of this and many other new features.

    http://www.digital-metaphors.com/rbWiki/General/What's_New

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2014
    Hello Nico,

    Unfortunatelly it's not possible for now.
    Maybe in future.
    In any case thanks for the replies

    Regards,
    Nicos

    On Tue, 28 Jan 2014 09:18:20 -0700, "Nico Cizik (Digital Metaphors)"
This discussion has been closed.