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
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