Email oSMTP - Need Error Handle

B

bhipwell

How do I create a code that will notify the user (a simple message box would
be fine) if an email does not get sent? I am using the ostrosoft function.
Thanks!

With oSMTP
.server = "theserver"
.MailFrom = "[email protected]"
.SendTo = "[email protected]
.MessageSubject = "Subject"
.MessageText = MessageTect
.Attachments.Add "C:\Files\File.pdf"
.SendEmail
End With

BH
 
T

Tom van Stiphout

Never heard of that software, but presumably .SendMail can either
return an error status, or throw a runtime error. Check with the
documentation.

-Tom.
Microsoft Access MVP
 
Top