Dim app As New Outlook.Application
Dim Item As Outlook.MailItem = app.CreateItem(0)
Try
Item.To = "123@126.com"
Item.Subject = subject
Item.Body = body
If attachName <> "" Then
Item.Attachments.Add(attachName)
End If
Item.Send()
Catch ex As Exception
MsgBox(ex.Message)
Finally
app.quit()
End
End Try
上面这段程序生成的exe,直接双击打开可以发邮件,但是以管理员运行却报错
这是为什么呢?