 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Byron Upchurch Guest
|
Posted: Wed May 16, 2007 8:49 pm Post subject: Sending mail with Outlook 2007 |
|
|
How do I send e-mail using Outlook 2007? I am using D7, with the following
code, and it 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 := 'nobody (AT) noplace (DOT) 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 |
|
| Back to top |
|
 |
Dmitry Streblechenko Guest
|
Posted: Wed May 16, 2007 10:11 pm Post subject: Re: Sending mail with Outlook 2007 |
|
|
Does the message get sent when you open Outlook?
Add the following code after creating an instance of the Outlook.Application
object.
NS := MSOutlook.GgetNamespace('MAPI')
NS.Logon;
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Byron Upchurch" <byron (AT) iqms (DOT) com> wrote in message
news:464b27a0$1 (AT) newsgroups (DOT) borland.com...
| Quote: | How do I send e-mail using Outlook 2007? I am using D7, with the
following
code, and it 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 := 'nobody (AT) noplace (DOT) 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
|
|
|
| Back to top |
|
 |
Byron Upchurch Guest
|
Posted: Fri May 18, 2007 9:15 pm Post subject: Re: Sending mail with Outlook 2007 |
|
|
Hello Dmitry,
Thank you very much. This worked!
Byron
"Dmitry Streblechenko" <dmitry (AT) dimastr (DOT) com> wrote in message
news:464b3a89$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Does the message get sent when you open Outlook?
Add the following code after creating an instance of the
Outlook.Application object.
NS := MSOutlook.GgetNamespace('MAPI')
NS.Logon;
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Byron Upchurch" <byron (AT) iqms (DOT) com> wrote in message
news:464b27a0$1 (AT) newsgroups (DOT) borland.com...
How do I send e-mail using Outlook 2007? I am using D7, with the
following
code, and it 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 := 'nobody (AT) noplace (DOT) 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
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|