Solved

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

Posted on 2003-11-03
14
587 Views
Last Modified: 2010-04-05
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.
0
Comment
Question by:hush021299
  • 5
  • 4
  • 4
  • +1
14 Comments
 
LVL 17

Expert Comment

by:geobul
ID: 9670368
Hi,

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

Regards, Geo
0
 
LVL 1

Expert Comment

by:tommyliu
ID: 9670474
Dear hush,

   you can add the file full path as below :

   TIdAttachment.Create(IdMessage.MessageParts, 'c:\temp\file.bmp');
0
 
LVL 6

Expert Comment

by:swift99
ID: 9676716
I would recommend ICS from overbyte.delphicenter.com.

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.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 1

Author Comment

by:hush021299
ID: 9680249
Dear
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

cheers
hh
0
 
LVL 17

Expert Comment

by:geobul
ID: 9685175
Hi,

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
0
 
LVL 6

Expert Comment

by:swift99
ID: 9686763
NM Components were first included in D3 I believe.  I remember struggling with them until someone on EE pointed me to ICS.

0
 
LVL 1

Author Comment

by:hush021299
ID: 9687991
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

Cheers
0
 
LVL 6

Expert Comment

by:swift99
ID: 9688292
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.
0
 
LVL 17

Expert Comment

by:geobul
ID: 9688774
Find TNMSmtp at your Fastnet component palette.
0
 
LVL 6

Assisted Solution

by:swift99
swift99 earned 125 total points
ID: 9689473
Also, with ICS, make use of the examples that come with the component set.  They, plus the source, are really the only documentation.
0
 
LVL 1

Author Comment

by:hush021299
ID: 9701173
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
0
 
LVL 17

Accepted Solution

by:
geobul earned 125 total points
ID: 9701839
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.
0
 
LVL 6

Expert Comment

by:swift99
ID: 9701856
Fastnet _IS_ NetMasters
0
 
LVL 1

Author Comment

by:hush021299
ID: 10200048
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:
 var
      lpRecip: PMapiRecipDesc;
begin
MapiResolveName(0, 0, PChar('smtp:hush2@web.de'), 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?
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to fill array with TArray.Create? 14 90
Using idhttp to login to instagram 2 89
Help on project with Soap 10 53
firemonkey Android Listview Sort items 7 10
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 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