L
lil lam
Hi,
I recently learned how to create a module that sends an email to
inform users that the db is finished running.
I wanted to know, if it is possible to send this email with an
attachment.
If so, how?
Please help!!
So far this is what I have.... and it just sends an email from your
outlook to let users know the database is done running and the reports
are done. I wanna know how can I attach the report as a csv file to
the email.
Function email()
Dim objOut As Object
Dim objTask As Object
Dim blnCrt As Boolean
Dim iLimit As Long
Dim db As Database
Dim EmailAddy As Recordset
Dim tDate As Date
Dim CLEDMATCH As String
Set db = CurrentDb()
Set EmailAddy = db.OpenRecordset("tbl_EmailAddresses", dbOpenTable)
tDate = Format(Date, "mm/dd/yyyy")
'''OUTLOOK
On Error Resume Next
Set objOut = GetObject(, "Outlook.Application")
If objOut Is Nothing Then
Set objOut = CreateObject("Outlook.Application")
blnCrt = True
If objOut Is Nothing Then
MsgBox "Unable to start Outlook."
Exit Function
I recently learned how to create a module that sends an email to
inform users that the db is finished running.
I wanted to know, if it is possible to send this email with an
attachment.
If so, how?
Please help!!
So far this is what I have.... and it just sends an email from your
outlook to let users know the database is done running and the reports
are done. I wanna know how can I attach the report as a csv file to
the email.
Function email()
Dim objOut As Object
Dim objTask As Object
Dim blnCrt As Boolean
Dim iLimit As Long
Dim db As Database
Dim EmailAddy As Recordset
Dim tDate As Date
Dim CLEDMATCH As String
Set db = CurrentDb()
Set EmailAddy = db.OpenRecordset("tbl_EmailAddresses", dbOpenTable)
tDate = Format(Date, "mm/dd/yyyy")
'''OUTLOOK
On Error Resume Next
Set objOut = GetObject(, "Outlook.Application")
If objOut Is Nothing Then
Set objOut = CreateObject("Outlook.Application")
blnCrt = True
If objOut Is Nothing Then
MsgBox "Unable to start Outlook."
Exit Function