Solved

Send Mail using OutlookExpress

Posted on 2000-03-22
5
157 Views
Last Modified: 2010-05-18
I want to send e-mail to a given recipient. The problem is that there should be a file attached. I made it using Outlook, but it doesn't work with OutlookExpress. Here is the code. Any idea ???


    OutlookApplication.Connect;
    NmSpace := OutlookApplication.GetNamespace('MAPI');
    NmSpace.Logon('', '', False, False);
    MailItem1.ConnectTo(OutlookApplication.CreateItem(olMailItem) as MailItem);
    MailItem1.Recipients.Add(ebMail.Text);
    MailItem1.Subject := 'sample';
    MailItem1.Attachments.Add('C:\abc.xls', EmptyParam, EmptyParam, EmptyParam);
    MailItem1.Send;
    Close;
0
Comment
Question by:simoraikov
5 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 2644548
It's not possible to use this code to control OutlookExpress, only Outlook. I think the only way to send attachments is using MAPImail from Simonet (Alex). You have seen that demo already I believe.
0
 
LVL 2

Expert Comment

by:florisb
ID: 2644566
Does outlook-express provide a library to import? Check it; as said; code above is Outlook.
0
 
LVL 2

Expert Comment

by:Serega
ID: 2645105
If OutlookExpress is default mailer in your system, you can do it simply by ShellExecute.
0
 
LVL 1

Author Comment

by:simoraikov
ID: 2648173
The problem is that I need to send attachment.
0
 

Accepted Solution

by:
Bmacri earned 100 total points
ID: 2836382
Try using SMTP delphi comes with an example  \Demos\SMTP

Try that
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

786 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