NWildblood
Technical User
Hi
Does anyone know where I can find how to send email to an email address within an Access table field ? I'm running Lotus Notes and Access 2002, I can generate the mail with atttached report, but just don't have the coding experience to work this one any further... Any help very gratefully received !!!
I have bodged someone else's code within the narrow limits of me VB.
(Further to that if anyone know how to send a report as the email text body I would be thrilled!)
_________
Option Compare Database
_________
Private Sub cmdEmail_Click()
Call fEmailNotification
End Sub
_________
Private Function fEmailNotification()
Dim rs As DAO.Recordset
Dim strEmailTo As String
Dim strSubject As String
Dim strMessage As String
strSubject = "JOB NUMBER REQUEST"
strMessage = "Please find your job number as requested"
'email notification
Set rs = CurrentDb.OpenRecordset("Select 'EmailAddress:' from tJOBGENERATOR ")
rs.MoveFirst
While Not rs.EOF
'Just in case there are multiple records that have been flagged...
If strEmailTo <> "" Then
strEmailTo = strEmailTo & "; " & rs!Email
Else
'Im getting RunTime Errror 3265 here:
strEmailTo = rs!Email
End If
rs.MoveNext
Wend
DoCmd.SendObject acReport, "qOutPutJob", "RichTextFormat(*.rtf)", strEmailTo, "", "", "strSubject", "strMessage", False, ""
End Function
_________
I know I need to declare Email Recipient, Subject & Message properly etc, just haven't the knowledge... Corrections, pointers, links most welcome - many thanks again!
"No-one got everything done by Friday except Robinson Crusoe...
Does anyone know where I can find how to send email to an email address within an Access table field ? I'm running Lotus Notes and Access 2002, I can generate the mail with atttached report, but just don't have the coding experience to work this one any further... Any help very gratefully received !!!
I have bodged someone else's code within the narrow limits of me VB.
(Further to that if anyone know how to send a report as the email text body I would be thrilled!)
_________
Option Compare Database
_________
Private Sub cmdEmail_Click()
Call fEmailNotification
End Sub
_________
Private Function fEmailNotification()
Dim rs As DAO.Recordset
Dim strEmailTo As String
Dim strSubject As String
Dim strMessage As String
strSubject = "JOB NUMBER REQUEST"
strMessage = "Please find your job number as requested"
'email notification
Set rs = CurrentDb.OpenRecordset("Select 'EmailAddress:' from tJOBGENERATOR ")
rs.MoveFirst
While Not rs.EOF
'Just in case there are multiple records that have been flagged...
If strEmailTo <> "" Then
strEmailTo = strEmailTo & "; " & rs!Email
Else
'Im getting RunTime Errror 3265 here:
strEmailTo = rs!Email
End If
rs.MoveNext
Wend
DoCmd.SendObject acReport, "qOutPutJob", "RichTextFormat(*.rtf)", strEmailTo, "", "", "strSubject", "strMessage", False, ""
End Function
_________
I know I need to declare Email Recipient, Subject & Message properly etc, just haven't the knowledge... Corrections, pointers, links most welcome - many thanks again!
"No-one got everything done by Friday except Robinson Crusoe...