Board index » delphi » Sending mail with Outlook 2007
Byron Upchurch
![]() Delphi Developer |
Sending mail with Outlook 20072007-05-16 06:37:46 AM delphi195 How do I send e-mail using Outlook 2007? I am using D7, with the following code works well with Outlook 2003 and prior versions: procedure TForm1.Button1Click(Sender: TObject); var MSOutlook, MSItem: OLEVariant; begin MSOutlook := CreateOleObject( 'Outlook.Application' ); // in ComObj.pas MSItem := MSOutlook.CreateItem(0); MSItem.To := 'XXXX@XXXXX.COM'; MSItem.Subject := 'hello'; MSItem.Body := 'Some message'; MSItem.Send; end; When I try this method with Outlook 2007, nothing happens. Any ideas what I might be doing wrong? Byron Upchurch |