Sending Outlook Email with Delphi
问题 I can successfully send an email by OLE between Delphi 10.4 and Outlook 365. try Outlook:=GetActiveOleObject('Outlook.Application'); except Outlook:=CreateOleObject('Outlook.Application'); end; try MailItem:= Outlook.CreateItem(olMailItem) ; SubjectLine:= 'Whatver'; MailItem.Subject:= SubjectLine; EmailTo:= 'somebody@somewhere.com'; MailItem.Recipients.Add(EmailTo); MailItem.BodyFormat := olFormatPlain; MailItem.GetInspector; Attachment:= 'C:\File.doc'; MailItem.Attachments.Add(Attachment);