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:
Dim objOutlook As Object
Dim objOutlookMsg As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(0)
With objOutlookMsg
.To = txt_ToEmail
.Subject = "Measurement data"
.Body = "Measurement data are in the attachment"
'.HTMLBody = "HTML version of message"
intFileNbr2 = FreeFile
.Attachments.Add (strFileName2)
.send
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
Re: Problem with email (Outlook)
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"
Re: Problem with email (Outlook)
That's a hive in the Windows Registry. Start > Run > regedit
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?
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.