CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Apr 2003
    Posts
    322

    How can I avoid seeing this dialogue when sending email from VB6?

    I'm using the code below from phinds in the FAQ to send email from a VB program, but I know it's going to cause a lot of concern with the users, and probably result in the user not sending the email, especially with the word "VIRUS" in the dialogue. See attached screenshot for dialogue of concern.


    Dim objOutlook As Object
    Dim objOutlookMsg As Object
    Set objOutlook = CreateObject("Outlook.Application")
    Set objOutlookMsg = objOutlook.CreateItem(0)
    With objOutlookMsg
    .To = "you@email.com
    .Cc = "ifneed@copy.com"
    .Subject = "Hello World (one more time)..."
    .Body = "This is the body of message"
    .HTMLBody = "HTML version of message"
    .Attachments.Add ("c:\myFileToSend.txt")
    .Send 'Let´s go!
    End With
    Set objOutlookMsg = Nothing
    Set objOutlook = Nothing
    Attached Images Attached Images  

  2. #2
    Join Date
    Oct 2001
    Location
    Melbourne, Australia
    Posts
    576

    Re: How can I avoid seeing this dialogue when sending email from VB6?

    there is two things (that I know of) that you can do.

    1. Uninstall that version of outlook and use access 2000 instead.
    2. Don't use outlook (or MAPI). Use SMTP, vbSendMail, CDO, or some other method instead.

    check out this post for more info.

    i don't think you can get rid of that message (unless if you want to code something to click the ok button automatically)

  3. #3
    Join Date
    Jan 2003
    Location
    7,107 Islands
    Posts
    2,487

    Re: How can I avoid seeing this dialogue when sending email from VB6?

    You can find the setting of that dialog box in the security tab under tools/options of the outlook express.
    Busy

  4. #4
    Join Date
    Oct 2001
    Location
    Melbourne, Australia
    Posts
    576

    Re: How can I avoid seeing this dialogue when sending email from VB6?

    Quote Originally Posted by Thread1
    You can find the setting of that dialog box in the security tab under tools/options of the outlook express.
    I don't think that option exists in Outlook though, only Outlook Express

  5. #5
    Join Date
    Jan 2003
    Location
    7,107 Islands
    Posts
    2,487

    Re: How can I avoid seeing this dialogue when sending email from VB6?

    Quote Originally Posted by Zeb
    I don't think that option exists in Outlook though, only Outlook Express
    If that may be the case then he may look for the other methods. I thought there are 5 ways to send email via VB as seen in the FAQ, he may check it out. But my favorite is talking with the SMTP protocol with winsock.
    Busy

  6. #6
    Join Date
    Apr 2003
    Posts
    322

    Re: How can I avoid seeing this dialogue when sending email from VB6?

    Quote Originally Posted by Thread1
    If that may be the case then he may look for the other methods. I thought there are 5 ways to send email via VB as seen in the FAQ, he may check it out. But my favorite is talking with the SMTP protocol with winsock.
    Yeah, but reading through all the emails, everything was shot down except this method

  7. #7
    Join Date
    Apr 2003
    Posts
    322

    Re: How can I avoid seeing this dialogue when sending email from VB6?

    Quote Originally Posted by Zeb
    there is two things (that I know of) that you can do.

    1. Uninstall that version of outlook and use access 2000 instead.
    2. Don't use outlook (or MAPI). Use SMTP, vbSendMail, CDO, or some other method instead.

    check out this post for more info.

    i don't think you can get rid of that message (unless if you want to code something to click the ok button automatically)
    Cant do that. This is on a corporate computer. Everyone must use Outlook.

  8. #8
    Join Date
    Oct 2001
    Location
    Melbourne, Australia
    Posts
    576

    Re: How can I avoid seeing this dialogue when sending email from VB6?

    Quote Originally Posted by cappy2112
    Cant do that. This is on a corporate computer. Everyone must use Outlook.
    So you probably have your own mail server, which means that the other options I listed would be the best. Im 99% certain you can't remove that dialog through code, a setting or registry hack or something, so you can either write something to click the box automatically (tough work), or just re-write that mail component to use a non-outlook/mapi method.

    vbSendMail is probably the easiest (and is linked to in the other post I gave you)

  9. #9
    Join Date
    Oct 2001
    Location
    Melbourne, Australia
    Posts
    576

    Re: How can I avoid seeing this dialogue when sending email from VB6?

    sorry - i should elaborate...

    the other options i listed just take the middle man (outlook) out of the equation. they speak direct with a mail server (i.e. microsoft exchange) to create and send emails. it gives you heaps more power and flexibility and allows you to bypass outlook completely for automating emails.

    the only issue is that it may mean that some configuration will be required on your mail server so that it doesn't think you are trying to send spam.

    but if you want to be able to preview emails in outlook or something like that before you send them (i.e. they aren't purely automated) then you probably can't use those options (at least, it is easier to just have the user click "yes" when the outlook window pops up)

  10. #10
    Join Date
    Jan 2004
    Location
    Southampton, UK
    Posts
    21

    Re: How can I avoid seeing this dialogue when sending email from VB6?

    You could take a look at the Micr$oft page: http://office.microsoft.com/en-us/assistance/HA011402931033.aspx?mode=print which deals with modifying the Outlook security template.

    After following the instructions on my system I no longer get bothered by the annoying prompt telling me that I'm sending an email (or other activity in outlook)

    Take a little while to follow the instructions carefully, and it should work.

    Good luck....

  11. #11
    Join Date
    May 2001
    Posts
    91

    Re: How can I avoid seeing this dialogue when sending email from VB6?

    Hi cappy,

    Another solution is using Outlook redemption, take a look at

    http://www.dimastr.com/redemption/

    AFAIK that works well
    have a nice day

    Patzer
    _____________________________
    Philo will never be forgotten

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured