This is the code, I deleted some of it due to security issues:
Private Sub cmdSendEmail_Click()
On Error GoTo Err_cmdSendEmail_Click
Dim stDocName As String
Dim strCustomer As String
Dim strEmail As String
Dim strMessage As String
Dim strSubject As String
Dim blnDeleteSent As Boolean
Dim blnDisplayMsg As Boolean
Dim blnReadReceipt As Boolean
Dim strEmailCC As String
Dim strBSOname As String
Dim strDate As String
Dim intResponse As Integer
Dim strCollateral As String
Dim strIneligible As String
Dim strProcessingMessageID As String
intResponse = MsgBox("WARNING: This process will send an email to the client." & vbLf & _
"Do you wish to coninue?", vbYesNo, "Processing Notice")
If intResponse <> vbYes Then
MsgBox "Processing Notice has been cancelled.", vbOKOnly
Exit Sub
End If
'Preview email message prior to sending if box is checked
If chkPreviewEmail = True Then
blnDisplayMsg = True
Else
blnDisplayMsg = False
End If
'Request read receipt to be sent if box is checked
If chkReadReceipt = True Then
blnReadReceipt = True
Else
blnReadReceipt = False
End If
'Send email but only save in Sent messages if box is checked on
If chkSaveSentMessage = True Then
blnDeleteSent = False
Else
blnDeleteSent = True
End If
strCustomer = cbocustomer.Column(1)
strEmail = [Primary Email]
strEmailCC = [LoanOfficerEmail]
strCollateral = Format([CollateralLoanValue], "$###,###,###,###")
strIneligible = Format([Ineligibles], "$###,###,###,###")
Select Case ReportingFrequency & " Client-" & cboReportingPeriod & " Rept"
Case "******** Client-Monthly Rept"
strProcessingMessageID = "1"
strSubject = Subject goes here
strMessage = Message goes here
Case "*******Client-Weekly Rept"
strProcessingMessageID = "2"
strSubject = Subject goes here
strMessage = Message goes here
Case "*******Client-Monthly Rept"
strProcessingMessageID = "3"
strSubject = Subject goes here
strMessage = Message Goes Here
Case "***** Client-Monthly Rept"
strProcessingMessageID = "4"
strSubject = Subject goes here
strMessage = Message goes here
Case "******Client-Weekly Rept"
strProcessingMessageID = "5"
strSubject = "Subject Goes here
strMessage = Message goes here
End Select
SendEmail blnDisplayMsg, blnDeleteSent, blnReadReceipt, strCustomer, strEmail, strEmailCC, strSubject, strMessage
'Log the email in the Processing Notices Sent table
CurrentDb.Execute " Insert into tblProcessingNoticeSent " & _
"(DateSent, Sentby, CustomerID,ReportingPeriod,LoanBaseDate, " & _
"CollateralLoanValue, Ineligibles, ProcessingNoticeMessageID, ContactEmail," & _
"BSOName, BSOEmail) VALUES" & _
"(#" & Date & " " & Time & "#,'" & _
stroutlooksender & "','" & _
Forms!frmProcessingNotice.cbocustomer & "', '" & _
Forms!frmProcessingNotice.cboReportingPeriod & "', '" & _
Forms!frmProcessingNotice.LoanBaseDate & "', '" & _
Forms!frmProcessingNotice.CollateralLoanValue & "', '" & _
Forms!frmProcessingNotice.Ineligibles & "', '" & _
strProcessingMessageID & "','" & _
Forms!frmProcessingNotice.[Primary Email] & "','" & _
Forms!frmProcessingNotice.[LoanOfficer] & "','" & _
Forms!frmProcessingNotice.[LoanOfficerEmail] & "');"
Exit_cmdSendEmail_Click:
Exit Sub
Err_cmdSendEmail_Click:
MsgBox Err.Description
Resume Exit_cmdSendEmail_Click
End Sub