[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

How send mail ?

Posted on 1999-11-01
8
Medium Priority
?
190 Views
Last Modified: 2010-04-04
How can I send my file - file.txt to
somebody@mail.net using Delphi2,3?
0
Comment
Question by:Vadik
8 Comments
 
LVL 3

Expert Comment

by:philipleighs
ID: 2175024
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
 

Author Comment

by:Vadik
ID: 2175302
And what is DSP ( TEmail - component)?
0
 

Author Comment

by:Vadik
ID: 2175309
Yes I find it!
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
LVL 3

Expert Comment

by:philipleighs
ID: 2175311
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
 
LVL 3

Expert Comment

by:philipleighs
ID: 2175324
Glad you found it!
0
 
LVL 6

Expert Comment

by:Stuart_Johnson
ID: 2176126
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
 
LVL 17

Expert Comment

by:inthe
ID: 2176199
yes and shellexecute cant do attachments only subject and message..
but temail is great component.
0
 
LVL 1

Accepted Solution

by:
fulg0re earned 60 total points
ID: 2176747
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This is an update to some code that someone else posted on Experts Exchange. It is an alternate approach, I think a little easier to use, & makes sure that things like the Task Bar will update.
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
In this video I will demonstrate how to set up Nine, which I now consider the best alternative email app to Touchdown.
Suggested Courses

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question