Determine if email bounced back

D

dw

Hi. I accidentally posted this to the German version ("de") of this
newsgroup until I realized my mistake -- sorry!

We're using the subroutine below to send emails via our classic ASP
apps. However, we'd like to know if an email address isn't good -- in other
words, it bounced back. Is there a way to do that with the CDOSYS email
method? The From email is just some generic text and not a real email
address in our apps.

One brute force technique is to hit the Active Directory and see if the
email's on it. Is there any other way? Does the CDOSYS method throw any
errors that can be trapped? It sends emails to bad email addresses just as
quietly as to good ones. Thanks.


Sub
sendMail_CDOSYS(prmMailFrom,prmMailTo,prmMailCC,prmMailSubject,prmMailBody)
Dim objCDOSYSMail, objCDOSYSCon

Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")

With objCDOSYSCon
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"myExchangeServer.myDomain.com"
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 60
.Fields.Update
End With

With objCDOSYSMail
Set .Configuration = objCDOSYSCon
.From = prmMailFrom
.To = prmMailTo
If Not IsNull(prmMailCC) And Len(Trim(prmMailCC)) > 0 Then .CC =
prmMailCC ' If there is a CC passed in, set the CC field to it.
.Subject = prmMailSubject
.HTMLBody = prmMailBody
.Send
End With

Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
End Sub
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top