Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automated Mail from Attachmate

Status
Not open for further replies.

Viajimf

Programmer
Apr 11, 2007
1
US
I am trying to send E-Mail from Attachmate, without the nuisance of being asked all the questions. I need to run scripts from a stand alone system (without operator intervention) using the Windows' Scheduler, which works fine, but would like to receive E-Mail when the tasks are completed.

The E-Mail code I have gotten from other questions answered causes the questions "A program is trying to access Email addresses you have stored in Outlook. Do you want to allow this?", and "A program is trying to automatically send e-mail on your behalf. Do you want to allow this?". Is there anyway to turn these questions off?

The code I am using (in its simplest form) is:

Sub Main
Dim myOlApp As Object, _
myItem As Object

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
myItem.Recipients.Add "My.Name@company.org"
myItem.Subject = "Test e-mail from script"
myItem.Body = "This is the message body."
myItem.Send

Close
End Sub
 
You'd have better chances of a response to this question if posted in forum707.

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Or google search "outlook object model guard"

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top