Hi There,
i am trying to send the mail using Outlook(MAPI) from VB. but when i send it confirms with me with a prompt Like
"A program is trying to automatically send e-mail on your behalf. do you want to allow this?
if this is unexpected, it may be a virus abd you should choose NO.
Yes NO Cancel
"
How can i solve this problem
I have written the following code.
Dim oObj As New Outlook.Application
Public WithEvents oNS As Outlook.Namespace
Public WithEvents oMI As Outlook.MailItem
Private Sub Form_Load()
Set oNS = oObj.GetNamespace("MAPI")
Set oMI = oNS.Application.CreateItem(olMailItem)
With oMI
.To = "xyz@abc.com"
.Subject = "Test Message"
.Body = "Test Message"
.Send
End With
End Sub
Thankx in advance
Mohit Prabhu
i am trying to send the mail using Outlook(MAPI) from VB. but when i send it confirms with me with a prompt Like
"A program is trying to automatically send e-mail on your behalf. do you want to allow this?
if this is unexpected, it may be a virus abd you should choose NO.
Yes NO Cancel
"
How can i solve this problem
I have written the following code.
Dim oObj As New Outlook.Application
Public WithEvents oNS As Outlook.Namespace
Public WithEvents oMI As Outlook.MailItem
Private Sub Form_Load()
Set oNS = oObj.GetNamespace("MAPI")
Set oMI = oNS.Application.CreateItem(olMailItem)
With oMI
.To = "xyz@abc.com"
.Subject = "Test Message"
.Body = "Test Message"
.Send
End With
End Sub
Thankx in advance
Mohit Prabhu