Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
snowman  
#1 Posted : Sunday, November 8, 2015 4:02:55 AM(UTC)
snowman

Rank: Newbie

Groups: Registered
Joined: 10/6/2015(UTC)
Posts: 1

I am generating a pdf file via an export from a database report and then attaching it to an email using
Quote:
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  
#2 Posted : Friday, September 18, 2020 2:46:30 AM(UTC)
Hossein

Rank: Newbie

Groups: Registered
Joined: 9/18/2020(UTC)
Posts: 0
Denmark

Did you find out?
Is it possible by using EASendMail?
I need too.
ivan  
#3 Posted : Friday, September 18, 2020 3:33:12 PM(UTC)
ivan

Rank: Administration

Groups: Administrators
Joined: 11/11/2010(UTC)
Posts: 1,084

Thanks: 9 times
Was thanked: 46 time(s) in 46 post(s)
please have a look at this topic: (resolved)

https://www.emailarchite...to-send-file-from-stream
WolfgangG  
#4 Posted : Monday, March 22, 2021 7:40:05 AM(UTC)
WolfgangG

Rank: Newbie

Groups: Registered
Joined: 3/22/2021(UTC)
Posts: 0
Germany
Location: Köln

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  
#5 Posted : Monday, March 22, 2021 11:36:08 PM(UTC)
WolfgangG

Rank: Newbie

Groups: Registered
Joined: 3/22/2021(UTC)
Posts: 0
Germany
Location: Köln

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.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2021, Yet Another Forum.NET
This page was generated in 0.420 seconds.

EXPLORE TUTORIALS

© All Rights Reserved, AdminSystem Software Limited.