Link to home
Start Free TrialLog in
Avatar of simoraikov
simoraikov

asked on

Send Mail using OutlookExpress

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;
Avatar of Epsylon
Epsylon

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.
Does outlook-express provide a library to import? Check it; as said; code above is Outlook.
If OutlookExpress is default mailer in your system, you can do it simply by ShellExecute.
Avatar of simoraikov

ASKER

The problem is that I need to send attachment.
ASKER CERTIFIED SOLUTION
Avatar of Bmacri
Bmacri

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial