Hayley Baxter
Registered User.
- Local time
- Today, 23:05
- Joined
- Dec 11, 2001
- Messages
- 1,607
Try this
Private Sub CmdEmail_Click()
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Dim strBody As String
Dim strbOdy1 As String
Dim strbody2 As String
Dim strbody3 As String
Dim strSubject As String
Dim strContactName As String
Dim StrCourseTitle As String
Dim strcoursefee As String
Set rsEmail = CurrentDb.OpenRecordset("QrySendEmails")
Do While Not rsEmail.EOF
strEmail = rsEmail.Fields("Email").Value
StrCourseTitle = rsEmail.Fields("CourseTitle").Value
strcoursefee = rsEmail.Fields("Coursefee").Value
strBody = "According to our records, you are enrolled on the"
strbOdy1 = "When you enrolled, you informed us that you where in receipt of a Mean Tested Benefit. You have not however, shown the college proof that you are in fact in receipt of this benefit."
strbody2 = "Can you therefore please take proof of your benefit with you to the Information & Guidance desk as soon as possible, along with this e-mail."
strbody3 = "Failure to provide this proof, will result in you being invoiced with the next 14 days for the course fee, which is £"
strbody4 = "Should you have any queries regarding this e-mail, please contact the Finance Office on (01642) 865428."
strContactName = rsEmail.Fields("ContactName").Value
strSubject = rsEmail.Fields("subject").Value
DoCmd.SendObject , , , strEmail, , , _
strSubject, _
"Hello " & strContactName & vbCrLf & vbCrLf & strBody & StrCourseTitle _
& vbCrLf & vbCrLf & strbOdy1 _
& vbCrLf & vbCrLf & strbody2 _
& vbCrLf & vbCrLf & strbody3 & strcoursefee _
& vbCrLf & vbCrLf & strbody4, True
rsEmail.MoveNext
Loop
Set rsEmail = Nothing
MsgBox "Emails have been sent"
End Sub
Private Sub CmdEmail_Click()
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Dim strBody As String
Dim strbOdy1 As String
Dim strbody2 As String
Dim strbody3 As String
Dim strSubject As String
Dim strContactName As String
Dim StrCourseTitle As String
Dim strcoursefee As String
Set rsEmail = CurrentDb.OpenRecordset("QrySendEmails")
Do While Not rsEmail.EOF
strEmail = rsEmail.Fields("Email").Value
StrCourseTitle = rsEmail.Fields("CourseTitle").Value
strcoursefee = rsEmail.Fields("Coursefee").Value
strBody = "According to our records, you are enrolled on the"
strbOdy1 = "When you enrolled, you informed us that you where in receipt of a Mean Tested Benefit. You have not however, shown the college proof that you are in fact in receipt of this benefit."
strbody2 = "Can you therefore please take proof of your benefit with you to the Information & Guidance desk as soon as possible, along with this e-mail."
strbody3 = "Failure to provide this proof, will result in you being invoiced with the next 14 days for the course fee, which is £"
strbody4 = "Should you have any queries regarding this e-mail, please contact the Finance Office on (01642) 865428."
strContactName = rsEmail.Fields("ContactName").Value
strSubject = rsEmail.Fields("subject").Value
DoCmd.SendObject , , , strEmail, , , _
strSubject, _
"Hello " & strContactName & vbCrLf & vbCrLf & strBody & StrCourseTitle _
& vbCrLf & vbCrLf & strbOdy1 _
& vbCrLf & vbCrLf & strbody2 _
& vbCrLf & vbCrLf & strbody3 & strcoursefee _
& vbCrLf & vbCrLf & strbody4, True
rsEmail.MoveNext
Loop
Set rsEmail = Nothing
MsgBox "Emails have been sent"
End Sub