Workaround email message "...trying to automatically send e-mail

P

Procuro

For quite some time I've been using the peace of code,
which I've cut short to the essential part, from within
Access to send e-mails. Until today everything as run
smoothly, but since XP has been installed Outlook is
always replying with:

Security message "...trying to automatically send e-mail
on your behalf

the same goes for the command docmd. SendObject.

Since I use both ways to send large numbers of e-mails per
day I'm getting desperate.

Is there a way, programmatically, to workaround the
security message, i.e., saying to Outlook that the
messages are genuine and from a trustworthy part?

Thank you for the help

Dim objApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myFoldSent As Outlook.mapiFolder
Dim Mail_msg As MailItem

Set objApp = CreateObject("Outlook.Application")
Set myNamespace = objApp.GetNamespace("MAPI")

Set myFoldSent = myNamespace.GetDefaultFolder
(olFolderSentMail)

Set Mail_msg = objApp.CreateItem(olMailItem)
Mail_msg.Subject = "Algo."
Mail_msg.Body = "O que se quiser." _
& vbNewLine & vbNewLine _
& "Algo mais!"
Mail_msg.To = "receivers name"

Mail_msg.Send

Set Mail_msg = Nothing
Set myFoldSent = Nothing
Set myNamespace = Nothing
Set objApp = Nothing
 
Top