Outlook queries automatic email (1 Viewer)

bunji

Registered User.
Local time
Today, 14:51
Joined
Apr 26, 2005
Messages
124
Hi I have created some code that sends an email to everyone who has email ticked. This works fine no problem. However i have Outlook XP and everytime it access creates a new email. Outlook pops up a warning saying that a program is trying to automatically send an email will you allow this yes or no.

Does anyone know how to automatically respond to this or switch the dam thing off!!! or bypass it.

Many Thanks
 

izyrider

Registered User.
Local time
Today, 15:51
Joined
Apr 17, 2005
Messages
67
google "redemption outlook"
...and make sure your IT folk are not watching if you use it.

izy
 

mr_e_landis

Registered User.
Local time
Today, 06:51
Joined
Feb 16, 2005
Messages
28
Can you supress the messege in the code?

I am having the same problem. I want to send some data to users specified when a button is clicked. This works great except for that message that pops up saying are you sure you want to send email blah, blah, blah. This is not making the mailing process as user friendly as I need it to be.

Is it possible to supress it in the code? Because MIS watches us very closely plus I work on a neutered machine :eek:. The MDE will be given to multiple users and I need to kill the message in the DB.
 

hooks

Registered User.
Local time
Today, 06:51
Joined
Aug 13, 2004
Messages
160
Bunji, One of your Exchange server admins can fix this for you. Im am not for sure how but my companys Exchange admin has done this before.

Hooks
 

bunji

Registered User.
Local time
Today, 14:51
Joined
Apr 26, 2005
Messages
124
Hooks; i am my exchange admin!!!! ha ha and i have tried searching the microsoft sites and even looked through and Outlook forum, but to no avail i haven't been able to search for the option to disable it. Maybe you can ask your exchange guys for me??

I have also been working on IzyRider's idea of using redemption but have had a few errors in my code if someone can help. I am trying to create an instance of the Outlook.Application object explicitly. But having a compile error which i have highlighted in red any ideas?

The code that i was using before trying redemption is commented out.

Public Function SendEMail()

Dim db As DAO.Database
Dim MailList As DAO.Recordset
Dim SafeItem, oItem
'Dim MyOutlook As Outlook.Application
'Dim MyMail As Outlook.MailItem

Dim Subjectline As String
Dim BodyFile As String
Dim fso As FileSystemObject
Dim MyBody As TextStream
Dim MyBodyText As String
Set fso = New FileSystemObject

'Set MyOutlook = New Outlook.Application

Set db = CurrentDb()

Set MailList = db.OpenRecordset("QryCustomerReceiveEmailNewsletter")

Do Until MailList.EOF

Set SafeItem = CreateObject("Redemption.SafeMailItem") 'Create an instance of Redemption.SafeMailItem
Set OutlookApp = CreateObject("Outlook.Application”) 'Sets application as Outlook
Set NS = OutlookApp.GetNamespace(“MAPI”)
NS.Logon
Set oItem = Application.CreateItem(0) 'Create a new message
SafeItem.Item = oItem 'set Item property

'Set MyMail = MyOutlook.CreateItem(olMailItem)

SafeItem.To = MailList("EMailAddress")
Subjectline$ = "Harrodian Flyer NewsLetter"

BodyFile$ = "c:\harrodianNewsLetter\EmailBody.txt"

' Check to make sure the file exists...

If fso.FileExists(BodyFile$) = False Then

MsgBox "The body file isn't where you say it is. " & vbNewLine & vbNewLine & _
"Quitting...", vbCritical, "I Ain't Got No-Body!"
Exit Function

End If

' Since we got a file, we can open it up.
Set MyBody = fso_OpenTextFile(BodyFile, ForReading, False, TristateUseDefault)

' and read it into a variable.
MyBodyText = MyBody.ReadAll

' and close the file.
MyBody.Close


'.Importance = olImportanceHigh 'High importance

'This gives it a subject
SafeItem.Subject = Subjectline$

'This gives it the body

SafeItem.Body = MyBodyText


'If you want to send an attachment
'uncomment the following line
' SafeItem.Attachments.Add "c:\harrodianNewsLetter\Harrodian Flyer Issue 2 .pdf", olByValue, 1, "Harrodian Flyer Issue 2"


'This sends it!
SafeItem.Send

'instead of automaticially sending it
'Uncomment the next line to see the email
'And comment the " SafeItem.Send" line above this.
' SafeItem.Display


'And on to the next one...
MailList.MoveNext


Loop

'Cleanup after ourselves
Set SafeItem = Nothing


'Uncomment the next line if you want Outlook to shut down when its done.
'Otherwise, it will stay running.


'MyOutlook.Quit
'Set MyOutlook = Nothing


MailList.Close
Set MailList = Nothing
db.Close
Set db = Nothing

End Function
 

bunji

Registered User.
Local time
Today, 14:51
Joined
Apr 26, 2005
Messages
124
From other forums i found someone make a suggestion of a program that will automatically click yes called Express clickYes, can be found at

http://www.contextmagic.com/downloads.htm

It's slow as you have to wait for outlook's 5 sec countdown per email you send but it will the job, if somewhat messy. I will continue to work on the safemail code and if i get it working i will post on here.
 

Users who are viewing this thread

Top Bottom