Board index » delphi » How to create mail message + attachment

How to create mail message + attachment

Hi All,

How can I create a mail message including a subject, a msg content and an
attachment?
I'm currently using the code below, but that does not seem to accept content
and attachments.

Thanks in advance,

Gerrit Beuze
ModelMaker Tools

procedure SendMail(const Address, Subject: string);
var
  R: HInst;
begin
  R := ShellExecute(0, // handle to parent window
                    nil, // pointer to string that specifies operation to
perform
                    PChar(Format('mailto:%s?subject=%s', [Address,
Subject])), // pointer to filename or folder name string
                    '', // pointer to string that specifies executable-file
parameters
                    nil, // pointer to string that specifies default
directory
                    SW_SHOWNORMAL);  // whether file is shown when opened
  if R <= 32 then
    raise Exception.Create('unable to use default "mailto:" command.');
end;

 

Re:How to create mail message + attachment


Check to following page for an example:

http://www.geocities.com/mshkolnik/FAQ/dct0049.htm

Re:How to create mail message + attachment


Thanks, just what I needed!

Gerrit Beuze

Quote
"Hans" <h...@anders.nl> wrote in message news:3b11a20b$1_1@dnews...
> Check to following page for an example:

> http://www.geocities.com/mshkolnik/FAQ/dct0049.htm

Re:How to create mail message + attachment


Better to use a new site - www.scalabium.com  - there added a lot of new
tips which are not presented on oldest (at geocities.com).

Hans D??? ???Y?? <3b11a20b$1_1@dnews> ...

Quote
>Check to following page for an example:

>http://www.geocities.com/mshkolnik/FAQ/dct0049.htm

Other Threads