I have the following function that runs through a macro:
What I need to do is sending an automated email and remind the users that they have to contact the clients if the date is correct.
I thought of scheduling the database to open at 07:00 am every day (the database is running on 24h open server), run an autoexec macro with the above code and then to close, but i have the following problem:
1. Everytime the sendObject command is trying to send an email I 'm getting a warning that a program is trying to send an email through outllook and wants acceptance from the user in order to proceed. Is it possible to disable the warning and send the emails immediately?
Thank you in advance
Code:
Public Function sendEmailF1()
Dim strSQL As String
Dim rs As DAO.Recordset
strSQL = "SELECT * FROM tblContactClients "
Set rs = CurrentDb.OpenRecordset(strSQL)
While Not rs.EOF
If (DateAdd("d", 2, rs.Fields("InsDate")) = Date) Then
DoCmd.SendObject _
, _
, _
, rs.Fields("InsEmail"), _
, _
, _
("" & "Reminder"), _
("" & "Contact " & rs.Fields("InsName")), _
False
End If
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
End Function
What I need to do is sending an automated email and remind the users that they have to contact the clients if the date is correct.
I thought of scheduling the database to open at 07:00 am every day (the database is running on 24h open server), run an autoexec macro with the above code and then to close, but i have the following problem:
1. Everytime the sendObject command is trying to send an email I 'm getting a warning that a program is trying to send an email through outllook and wants acceptance from the user in order to proceed. Is it possible to disable the warning and send the emails immediately?
Thank you in advance
