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 = "(e-mail address removed)"
.SendTo = "(e-mail address removed)
.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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top