how to send a mail with attachments without using the standard mail client?

how to send a mail with attachments without using the standard mail client?
I want my application to send a mail with attachments, without using "outlook" as standard mail client.
Currently I use a tmapi component which produce a mail located in the outbox folder, the same happend with an own unit I ve used before. I want to be able to send a mail independent whether outlook is running.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.


Use TIdSMTP from Indy or TNMSMTP from Fastnet. If you need sample code just let me know.

Regards, Geo
Dear hush,

   you can add the file full path as below :

   TIdAttachment.Create(IdMessage.MessageParts, 'c:\temp\file.bmp');
I would recommend ICS from

But I have successfully submitted MIME encoded mail using the netMasters component.

You need to read the RFC's on SMTP and MIME, and ensure that your mail is constructed in a MIME compliant manner.  That is all.
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

hush021299Author Commented:
Geobul, This TNMSMTP is too expensive for me.
tommzliu: I do not understand what you mean with this code
swift99: I have downloaded ICS, and will install. Let me see what happens further


What version of Delphi are you using? NM components are built in Delphi since version 5 (at least). Indy is free. ICS is good also but I can't help you there.

Regards, Geo
NM Components were first included in D3 I believe.  I remember struggling with them until someone on EE pointed me to ICS.

hush021299Author Commented:
I have D5.
So far I didnt find those NM components.
With the ICS I have some trouble, since I tried the sendmail application from the office. I did not manage to get it done yet.
The problem is, if I will be able to enter everything to get it done, I am not sure the user does!
I will try ICS from at home later.
If I get the URL I will try this indi component as well

ICS is asynchronous, and this throws most people at first.  When you say "send", it kicks off the send process, and the process occurs as events are triggered by the Windows event loop.

In D5 they are the "Internet" component pallette, TSMTP, TFTP, etcetera.
Find TNMSmtp at your Fastnet component palette.
Also, with ICS, make use of the examples that come with the component set.  They, plus the source, are really the only documentation.
hush021299Author Commented:
Then I dont need to go that far.
There is a smtpdemo project in the D5 demos fastnet folder

This example runs, but also here it is hard to find the values to pas in the program.
Also here I didnt get it sending a mail

Let me try it with the delphi example from @home
NMSMTP has an example with explanations in the Delphi help also. Select the component, press F1, select List method of the component and select 'Example' link.

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
Fastnet _IS_ NetMasters
hush021299Author Commented:
A question to geobul,

I thought I had a solution to send a mail with att.  but it doesnt work as i liked it.
Using tmapimail I get a message box from outlook everytime it need to resolve a address with:
      lpRecip: PMapiRecipDesc;
MapiResolveName(0, 0, PChar(''), 0, 0, lpRecip);

Obviously a security patch from Outlook 2002 onwards.

Now, how can I come further?

I have installed the INDY components.
Is there a simple example of just sending a mail?
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

From novice to tech pro — start learning today.