Thanks again for the response. I modified the module like you said and it now looks like this:
Public Sub Send(recipients As String, from As String, subject As String, smtpServer As String, Optional msg As String, Optional attachPath As String)
On Error GoTo handler
Dim iMsg As Object
Dim iConf As Object
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
'set up configuration
With iConf
With .Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp-server.neo.rr.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 0 'cdoAnonymous
.Update
End With
End With
'configure message
With iMsg
Set .Configuration = iConf
.To = "sendto address"
.from = "sentfrom address"
.subject = "Daily Transcription Report"
If msg <> "" Then .TextBody = msg
If attachPath <> "" Then .AddAttachment attachPath
.Send
End With
'tidy up
Set iMsg = Nothing
Set iConf = Nothing
Exit Sub
handler:
Err.Raise Err, Err.Source & " - Lib.Mail.Send()"
End Sub
I hope that I got it right, but then I went into the switchboard to add the private su to the OnClick of the cmdBotton, it would only allow no to use the expression builder and would not let me even get to the code to add anything. Does this mean that I should probably make my own switchboard from a form, so I can add that code? Thanks again for all of the help.