snowman
  • snowman
  • 57.5% (Neutral)
  • Newbie Topic Starter
9 years ago
I am generating a pdf file via an export from a database report and then attaching it to an email using

oSmtp := TMail.Create(Application);
oSmtp.LicenseCode := EASEND_MAIL_KEY;
oSmtp.FromAddr := 'xxx@xxx.co.uk';
... other oSmtp parameters
oSmtp.AddAttachment(Filename);
oSmtp.SendMail;


Since I will be sending quite a lot of these very quickly I thought it would be faster to export the pdf to a Memory stream and attach that to the email instead of writing it to disc and reading it back.

I can make the pdf memory stream ok, but how do I attach it to the email using EASendMail ?

(Using Delphi 2009)
Hossein
4 years ago
Did you find out?
Is it possible by using EASendMail?
I need too.
ivan
  • ivan
  • 100% (Exalted)
  • Administration
WolfgangG
4 years ago
Has this been resolved?

I am currently evaluating the use of EASendMail for your software products and need to be able to create Mail Attachments (e.g. PDF) from Memory Streams.

I have looked at the resolved topic above which is suggested as solution. But I am using the .NET component and in this SmtpMail does not have a method AddAttachment1.
WolfgangG
4 years ago
Ok, I figured out myself how to do it. I can use

Mail.AddAttachment(FileName, MyStream.ToArray)

I was confused because the documentation says that FileName must be "a full file name" which I understood as full path. But it works by just providing a file name to be shown in the mail.

EXPLORE TUTORIALS

© All Rights Reserved, AIFEI Software Limited & AdminSystem Software Limited.