By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,710 Members | 1,626 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,710 IT Pros & Developers. It's quick & easy.

dissable confirmation message

P: 26

Please help me.

I have seen similar problem in this forum but the answer is related to something else.
I have created a small program to send e-mail (MS Outlook) automatically when certain conditions are met. But when i want to send message program is prompting for confirmation with the following message. I want to dismiss this message with default option Yes and program should send automatically the mail with out user response.


" A program is trying to automatically send e-mail on your behalf. Do you want to allow this? ...................... choose "No".

How to solve this problem? Please find my code below.

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdsend_Click()
  3. Dim sendto As String
  4. Dim subject As String
  5. Dim Text As String
  7. sendto = txtTo.Text
  8. subject = txtSubject.Text
  9. Text = txtMessage.Text
  11. On Error GoTo ErrHandler
  12.     With MAPISession1
  13.             .DownLoadMail = False
  14.             .LogonUI = True
  15.             .SignOn
  16.             .NewSession = True
  17.             MAPIMessages1.SessionID = .SessionID
  18.     End With
  19.     With MAPIMessages1
  20.         .Compose
  21.         .RecipAddress = sendto
  22.         .AddressResolveUI = True
  23.         .ResolveName
  24.         .MsgSubject = subject
  25.         .MsgNoteText = Text
  26.         .Send False
  28.     End With
  30. ErrHandler:
  32. End Sub
Thank you.
Feb 26 '07 #1
Share this Question
Share on Google+
2 Replies

P: 1,646
Hi. This sounds like your virus protection software interrupting your email. You can't change that in your code but you can disable this feature of your virus software.
Feb 26 '07 #2

Expert 100+
P: 839
I could be the designed behavior of the MAPI libraries.
I had the same problem with VB6 + Outlook Express.

But using .Net MailMessage class, I have no more that prompt.
Feb 26 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.