J
job2125
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TTelfrmDetail.SendOutlookMail(SEmail:string);
const
olMailItem = 0;
var
Outlook: OleVariant;
vMailItem: variant;
fpath:string;
mfile:TiniFile;
begin
try
Outlook := GetActiveOleObject('Outlook.Application');
except
try
Outlook := CreateOleObject('Outlook.Application');
except
MessageBox(handle,'你的系统没有安装OutLook程序!','系统提示',64);
Exit;
end;
end;
fpath := ExtractFilePath(Paramstr(0))+'sendEmail.ini';
mFile:=TiniFile.Create(fpath);
vMailItem := Outlook.CreateItem(olMailItem);
vMailItem.Recipients.Add(SEmail);
vMailItem.Subject := mFile.ReadString('sendEmail','Subject','');
vMailItem.Body := mFile.ReadString('sendEmail','Body','');
vMailItem.Attachments.Add(mFile.ReadString('sendEmail','Attachments',''));
// vMailItem.Send;
VarClear(Outlook);
mFile.Free;
end;
系统提示找不到outlook,但我系统中明明装了outlook,请高手致电迷津。
const
olMailItem = 0;
var
Outlook: OleVariant;
vMailItem: variant;
fpath:string;
mfile:TiniFile;
begin
try
Outlook := GetActiveOleObject('Outlook.Application');
except
try
Outlook := CreateOleObject('Outlook.Application');
except
MessageBox(handle,'你的系统没有安装OutLook程序!','系统提示',64);
Exit;
end;
end;
fpath := ExtractFilePath(Paramstr(0))+'sendEmail.ini';
mFile:=TiniFile.Create(fpath);
vMailItem := Outlook.CreateItem(olMailItem);
vMailItem.Recipients.Add(SEmail);
vMailItem.Subject := mFile.ReadString('sendEmail','Subject','');
vMailItem.Body := mFile.ReadString('sendEmail','Body','');
vMailItem.Attachments.Add(mFile.ReadString('sendEmail','Attachments',''));
// vMailItem.Send;
VarClear(Outlook);
mFile.Free;
end;
系统提示找不到outlook,但我系统中明明装了outlook,请高手致电迷津。