D
David Meiner
Hi!
Working through hundreds of newsgroup items nobody seems to have problems
creating E-mails with Redemption.
But I have: I cannot get the body / HTML body of the E-mail filled.
The "To", "Subject" and "Attachment" get created correct - but the "body"
never shows anything.
My config: Delphi 5, Outlook 2002, Redemption trial - latest version.
Perhaps someone can help. Here's my code:
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, OleServer, Outlook2000, ComObj, ActiveX, Outlook_TLB,
Redemption_TLB, mapi;
(...)
procedure TForm1.Button1Click(Sender: TObject);
var
oItem,myFolder, sItem, myitems :variant;
Folder: Outlook_tlb.MAPIFolder;
NmSpace: NameSpace;
myMessage: TMapiMessage;
lpSender, lpRecepient: TMapiRecipDesc;
FileAttach: TMapiFileDesc;
SM: TFNMapiSendMail;
MAPIModule: HModule;
begin
outlookapplication.Connect;
NmSpace := outlookapplication.GetNamespace('MAPI');
NmSpace.Logon('', '', False, False);
oItem:=outlookapplication.CreateItem(olMailItem);
sItem:=CreateOleObject('Redemption.SafeMailItem');
oItem.Subject := 'my subject'; //ok.
oItem.save;
sItem.Item := oItem;
sItem.Recipients.Add('(e-mail address removed)'); //ok.
sItem.Attachments.Add('C:\test.dat'); //ok.
sItem.Body:='<html>not shown</html>'; //ok.
sItem.htmlBody:='<html>not shown</html>'; //ok.
sItem.bodyformat:=olFormatPlain;
sItem.save;
sItem:=0;
oitem:=0;
outlookapplication.Disconnect;
end;
Already tried oItem.save and sItem.save on different lines...
Regards,
David
Working through hundreds of newsgroup items nobody seems to have problems
creating E-mails with Redemption.
But I have: I cannot get the body / HTML body of the E-mail filled.
The "To", "Subject" and "Attachment" get created correct - but the "body"
never shows anything.
My config: Delphi 5, Outlook 2002, Redemption trial - latest version.
Perhaps someone can help. Here's my code:
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, OleServer, Outlook2000, ComObj, ActiveX, Outlook_TLB,
Redemption_TLB, mapi;
(...)
procedure TForm1.Button1Click(Sender: TObject);
var
oItem,myFolder, sItem, myitems :variant;
Folder: Outlook_tlb.MAPIFolder;
NmSpace: NameSpace;
myMessage: TMapiMessage;
lpSender, lpRecepient: TMapiRecipDesc;
FileAttach: TMapiFileDesc;
SM: TFNMapiSendMail;
MAPIModule: HModule;
begin
outlookapplication.Connect;
NmSpace := outlookapplication.GetNamespace('MAPI');
NmSpace.Logon('', '', False, False);
oItem:=outlookapplication.CreateItem(olMailItem);
sItem:=CreateOleObject('Redemption.SafeMailItem');
oItem.Subject := 'my subject'; //ok.
oItem.save;
sItem.Item := oItem;
sItem.Recipients.Add('(e-mail address removed)'); //ok.
sItem.Attachments.Add('C:\test.dat'); //ok.
sItem.Body:='<html>not shown</html>'; //ok.
sItem.htmlBody:='<html>not shown</html>'; //ok.
sItem.bodyformat:=olFormatPlain;
sItem.save;
sItem:=0;
oitem:=0;
outlookapplication.Disconnect;
end;
Already tried oItem.save and sItem.save on different lines...
Regards,
David