M
MikeP125
Hi,
I am trying to have my Access 2003 database send an email through Outlook
2003 without have ing Outlook opened. I have the code that works, except I
get this security warning that says:
"A program is trying to automatically send e-mail on your behalf. Do you
want to allow this?"
Then I need to manually click "Yes". How can I avoid this warning box and
have the email automatically be sent out? Below is my code:
Public Function Reminder1Email()
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
' Create the Outlook session.
Set objOutlook = New Outlook.Application
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
.subject = DLookup("[Subject]", "qrySendRemider1")
.To = DLookup("[EmailReminderAddress]", "qrySendRemider1")
.body = DLookup("[Message]", "qrySendRemider1") & vbCrLf & "This is an
automated message. Please do not respond"
.Importance = olImportanceHigh
.Send
End With
End Function
Thanks for your help.
I am trying to have my Access 2003 database send an email through Outlook
2003 without have ing Outlook opened. I have the code that works, except I
get this security warning that says:
"A program is trying to automatically send e-mail on your behalf. Do you
want to allow this?"
Then I need to manually click "Yes". How can I avoid this warning box and
have the email automatically be sent out? Below is my code:
Public Function Reminder1Email()
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
' Create the Outlook session.
Set objOutlook = New Outlook.Application
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
.subject = DLookup("[Subject]", "qrySendRemider1")
.To = DLookup("[EmailReminderAddress]", "qrySendRemider1")
.body = DLookup("[Message]", "qrySendRemider1") & vbCrLf & "This is an
automated message. Please do not respond"
.Importance = olImportanceHigh
.Send
End With
End Function
Thanks for your help.