独角兽企业重金招聘Python工程师标准>>>
1、核心代码
Dim objOutlookDim objOutMsgDim olMailItem'Create the Outlook object and the new mail object.Set objOutlook = CreateObject("Outlook.Application")Set objOutlookMsg = objOutlook.CreateItem(olMailItem)Set mapi = objOutlook.GetNameSpace("MAPI")'Define mail recipientsobjOutlookMsg.To = "mengfeiyang@"' = "my@"'objOutlookMsg.BCC = "my@"'Body of the messageobjOutlookMsg.Subject = "QTP Test Mail"objOutlookMsg.Body = "This is a test mail"'Display the mailobjOutlookMsg.Display'Send the messageobjOutlookMsg.Send'Release the objectsSet objOutlook = NothingSet mapi = Nothing
2、完整工程
代码直接导入UFT中即可。
/cBVxDWBf3zRBN (提取码:cff6)