How send mail ?

How can I send my file - file.txt to
somebody@mail.net using Delphi2,3?
VadikAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

philipleighsCommented:
Hi,

If you have MAPI then use TEmail from the DSP. The file name to search for is temail2.zip (free+src).

You can do stuff like this:

procedure TForm1.Button1Click(Sender: TObject);
begin
Email1.Recipient.Add(Edit1.Text);
Email1.Subject := Edit2.Text;
Email1.SetLongText(PChar(Memo1.Text));
Email1.Attachment.Add('c:\temp\file.txt');
if Email1.SendMail <> EMAIL_OK then
  ShowMessage('fail');
end;


Alternatively you can use ShellExecute which will use the default mail client to send the message.

ShellExecute(
   Application.Handle,
   'open',
   'mailto:someone@somewhere.outthere',
   ....

You can have the address and content filled out like this:
   'mailto:someone@somewhere.outthere?subject=Hi&body=The Message'

There is probably something extra that lets you specify attachments.

Cheers,
Phil.
0
VadikAuthor Commented:
And what is DSP ( TEmail - component)?
0
VadikAuthor Commented:
Yes I find it!
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

philipleighsCommented:
Oh, sorry.
"Delphi Super Page"

If you've never been there you should defninitely check it out. There are 1000's of free components you can download.

The URL is:
http://sunsite.icm.edu.pl/delphi/

Cheers,
Phil.
0
philipleighsCommented:
Glad you found it!
0
Stuart_JohnsonCommented:
Vadik,

Do you have a MAPI compliant e-mail application installed on your PC?  MS Outlook Express which comes with IE 5 does not appear to have any setting for MAPI configuration (that I have found).

Stu.

0
intheCommented:
yes and shellexecute cant do attachments only subject and message..
but temail is great component.
0
fulg0reCommented:
and ofcourse, if you use Delphi 4/5 you already got one of the best inet components: Fastnet. just put smtp component on form, fill properties and shoot! or use another top knotch component from:
http://www.rtfm.be/fpiette/indexuk.htm
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.