Results 1 to 6 of 6

Thread: Problem with email (Outlook)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2010
    Location
    Zagreb
    Posts
    29

    Problem with email (Outlook)

    Hi, I am tryin to send e-mail automaticaly with vb6, and for this I am using the code down here.

    But the problem is with Outlook, when the e-mail should be sent. Outlook pops up a notification: "A program is trying to automatically send an email on my behalf. Do You want to allow this?". And there is to choose YES or NO.

    How can this YES be chosen automatically from vb? (Because, the assumption is that user will not be present to click YES after he runs the application!)

    VB6 Code:
    1. Dim objOutlook As Object
    2. Dim objOutlookMsg As Object
    3.  
    4. Set objOutlook = CreateObject("Outlook.Application")
    5. Set objOutlookMsg = objOutlook.CreateItem(0)
    6.  
    7. With objOutlookMsg
    8.  
    9.   .To = txt_ToEmail
    10.   .Subject = "Measurement data"
    11.   .Body = "Measurement data are in the attachment"
    12.   '.HTMLBody = "HTML version of message"
    13.    intFileNbr2 = FreeFile
    14.   .Attachments.Add (strFileName2)
    15.   .send
    16.  
    17. End With
    18.  
    19. Set objOutlookMsg = Nothing
    20. Set objOutlook = Nothing

  2. #2
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2010
    Location
    Zagreb
    Posts
    29

    Re: Problem with email (Outlook)

    Hi, thanks.

    I found this at the link, but i can't find this HKEY_CURRENT_USER in computer? Do You have any idea where it could be? In Program Files, Windows or....?

    "The workaround is to disable this security prompt by setting/creating a REG_DWORD registry entry CheckAdminSettings = 1 located at HKEY_CURRENT_USER\Software\Policies\Microsoft\Security.

    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\Software\Policies\Microsoft\Security] "CheckAdminSettings"=dword:00000001"

  4. #4
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Problem with email (Outlook)

    That's a hive in the Windows Registry. Start > Run > regedit

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Oct 2010
    Location
    Zagreb
    Posts
    29

    Re: Problem with email (Outlook)

    Ok, I found next: HKEY_CURRENT_USER\Software\Policies\Microsoft\,
    but now there is not Security folder in that Microsoft folder. There are SystemCertificates and Windows. I don't know where should I put it now. I don' want to do something wrong. Do You have a clue what to do?

  6. #6
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Problem with email (Outlook)

    It might be different key (what looks like a folder is called a 'key' in the registry, and files/items are called 'values'. The top/main keys are called hives (HKEY_...)) for different versions of Windows/Outlook.
    I'm on a Mac now so I can't check how it looks. I found that link by Googling, give it a try you might find other suggestions.

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