Forum Discussion
Automatically Send Email Reminder upon opening Main Menu Form
This partial works but not completely. So I want the email reminders to be automatically sent upon opening the main menu (See below)
This is the code I am using
'SEND EMAIL REMINDER FOR LICENCE EXPIRY IN 30 DAYS
Dim O As Outlook.Application
Dim M As Outlook.MailItem
Set O = New Outlook.Application
Set M = O.CreateItem(olMailItem)
With M
.BodyFormat = olFormatHTML
.HTMLBody = "Please be aware that " & FirstName & LastName & " Licence is Due for renewal in the next 30 days. Licence Expiry is -" & LicenceExpiry & ",<P>" & _
"Please update New Licence Expiry date and upload copy of New Drivers Licence" & ",<P>" & _
"Kind Regards" & ",<P>" & _
"Kym Wilson"
.To = AssignedToEmployeeEmail
.CC = PersonalEmail
.Subject = "Licence Expiry Due in 30 Days " & Now()
.Display
End With
Set M = Nothing
Set O = Nothing
This will open my outlook but wont put the emails in from the form because I haven't directed it to form that I need to use and I don't know how to do this? below is the form I need the code to take the information from (p.s. I know personal email is not in there )
Thanks in advance
you then need another table to save the license and the expiry date, so next time you check this table and if the expiring license is found, it will not create email again.