N
Nirmal Singh
I am using Delphi automation to create an email from a template and send it.
s:='myFile.oft';
MailItem.ConnectTo(OutlookApplication1.CreateItemFromTemplate(s) as MailItem);
MailItem.Subject:='Greetings';
SafeMailItem.Item:=MailItem.DefaultInterface;
SafeMailItem.Body:='How are you today? This is version 10';
SafeMailItem.Attachments.Add('c:\boot.ini', olByValue, 1, 'Boot.ini');
SafeMailItem.Recipients.Add(NewAddress);
SafeMailItem.Send;
This all seems to work. However, when I open Outlook, the email is held in the Drafts folder. I then need to send/receive all
to actually send it.
How can I make sure it gets sent by automation?
Nirmal Singh
s:='myFile.oft';
MailItem.ConnectTo(OutlookApplication1.CreateItemFromTemplate(s) as MailItem);
MailItem.Subject:='Greetings';
SafeMailItem.Item:=MailItem.DefaultInterface;
SafeMailItem.Body:='How are you today? This is version 10';
SafeMailItem.Attachments.Add('c:\boot.ini', olByValue, 1, 'Boot.ini');
SafeMailItem.Recipients.Add(NewAddress);
SafeMailItem.Send;
This all seems to work. However, when I open Outlook, the email is held in the Drafts folder. I then need to send/receive all
to actually send it.
How can I make sure it gets sent by automation?
Nirmal Singh