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.GetName space('MAP I');
NmSpace.Logon('', '', False, False);
MailItem1.ConnectTo(Outloo kApplicati on.CreateI tem(olMail Item) as MailItem);
MailItem1.Recipients.Add(e bMail.Text );
MailItem1.Subject := 'sample';
MailItem1.Attachments.Add( 'C:\abc.xl s', EmptyParam, EmptyParam, EmptyParam);
MailItem1.Send;
Close;
OutlookApplication.Connect
NmSpace := OutlookApplication.GetName
NmSpace.Logon('', '', False, False);
MailItem1.ConnectTo(Outloo
MailItem1.Recipients.Add(e
MailItem1.Subject := 'sample';
MailItem1.Attachments.Add(
MailItem1.Send;
Close;
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.
ASKER
The problem is that I need to send attachment.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.