Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
'declare the smtp email object
Public WithEvents oSMTP As OSSMTP.SMTPSession
Public strSendFileName As String
Public strCompressedFileName As String
' on form load
'prepare email object for use
Set oSMTP = New OSSMTP.SMTPSession
Private Sub SendEmail()
Dim sError As String
'handle errors
On Error GoTo SendEmailErr
With oSMTP
'for now, assume no authentication on SMTP machine
.AuthenticationType = 0
'use the simplified syntax to just add a fully specified path name for attachment
.Attachments.Add strWorkingDirectory & "\" & strCompressedFileName
'prepare standard email content (eg. server, from, to, subject etc.)
.Server = strEmailServer
.MailFrom = strEmailFrom
.SendTo = strEmailTo
.MessageSubject = strEmailSubject
.MessageHTML = strEmailMessageBody
'NB: need to set a return reciept here -how
'send the message
.SendEmail
End With
Exit Sub
SendEmailErr:
sError = "Received an error trying to send email: " & _
" Error Number: " & Trim(Str(Err.Number)) & vbCrLf & _
" Description: " & Err.Description
Call PutMsg(sError)
Call MsgBox(sError, vbCritical, "Unable to send email")
Unload Me
End Sub