Hi Guys,
I have using MAPI to send emails in vb.net. I have using the default profile (MS Exchange Settings). I have set showdialog=false but still I get some dialog boxes. Is it possible if we can not show this dialogbox ? here's the code
Dim oSession As New MAPI.Session
oSession.Logon("MS Exchange Settings", , False, True)
Dim oMessage As MAPI.Message
Dim oAttach As MAPI.Attachment
Dim oRecipient As MAPI.Recipient
oMessage = oSession.Outbox.Messages.Add
oRecipient = oMessage.Recipients.add
oRecipient.Name = "Some One"
oRecipient.Resolve()
oMessage.Subject = "List"
oAttach = oMessage.Attachments.Add
oAttach.Source = sPath
oAttach.ReadFromFile(sPath)
Try
oMessage.Send(True, False)
Catch ex As Exception
MsgBox(ex.Source)
End Try
oSession.Logoff()
The dialog box Outlook show is
A program is trying to access email addresses you have stored in Outlook. Do you want to allow this ?
A program is trying to send email on your behalf. Do you want to allow this ?
Is there any way so that Outlook doesn't show these dialog boxes ?
Any Ideas ?
Thanks
Premal
I have using MAPI to send emails in vb.net. I have using the default profile (MS Exchange Settings). I have set showdialog=false but still I get some dialog boxes. Is it possible if we can not show this dialogbox ? here's the code
Dim oSession As New MAPI.Session
oSession.Logon("MS Exchange Settings", , False, True)
Dim oMessage As MAPI.Message
Dim oAttach As MAPI.Attachment
Dim oRecipient As MAPI.Recipient
oMessage = oSession.Outbox.Messages.Add
oRecipient = oMessage.Recipients.add
oRecipient.Name = "Some One"
oRecipient.Resolve()
oMessage.Subject = "List"
oAttach = oMessage.Attachments.Add
oAttach.Source = sPath
oAttach.ReadFromFile(sPath)
Try
oMessage.Send(True, False)
Catch ex As Exception
MsgBox(ex.Source)
End Try
oSession.Logoff()
The dialog box Outlook show is
A program is trying to access email addresses you have stored in Outlook. Do you want to allow this ?
A program is trying to send email on your behalf. Do you want to allow this ?
Is there any way so that Outlook doesn't show these dialog boxes ?
Any Ideas ?
Thanks
Premal