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

Problem to use SendMail function

edited August 2009 in General
I use RB 10.09, and these code:

Rel.EmailSettings.FileName := 'NFeDANFE';
Rel.EmailSettings.Recipients.Text := aTo;
Rel.EmailSettings.Subject := aSubject;
Rel.EmailSettings.Body.Text := StringReplace(aMsgBody, ';;;', #13#10,
[rfReplaceAll]);
Rel.EmailSettings.Attachments.Text := StringReplace(aFilesAttach, ';;;',
#13#10, [rfReplaceAll]);

Rel.SendMail;

When I put some Attach file, the RB doesn't attach any file,include the
Report.pdf... if Attachments is clear... the Report.pdf go fine...

Where is my error?

in time:

aFilesAttach := 'c:\test.xml;;;c:\test2.xml;;;';

Thanks.

Comments

  • edited August 2009
    Hi Fellipe,

    Rather than assigning the Attachments.Text, use the Attachments.Add()
    routine to individually add each attachment to the list.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2009
    Hi Nico,

    I try... but not work ...

    for i := 0 to ListAttach.Count -1 do
    Attachments.Add(ListAttach.Strings[i]) ;

    Same problem.. if I attach only one file, the RB doesn't attach any file...

    Regards,
    Fellipe H.

  • edited August 2009
    Hi Fellipe,

    Which email plugin are you trying to send with?

    1. You need to be sure you are using the full path of the files you are
    trying to attach.
    2. Also be sure all the files you are attaching actually exist on your hard
    drive.

    In my testing with RB 11, attaching multiple files seemed to function
    correctly. If you would like, you can send me a simple example that
    demonstrates the issue for RB 10.09 and I can test it here with the latest
    version of ReportBuilder. Send the example in .zip format to
    support@digital-metaphors.com.

    --
    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.