CDONTS.NewMail Object and Windows Server 2003

P

Paul

I am using the CDONTS.NewMail object to send e-mail programmatically.

We upgraded our IIS server from NT to Windows 2003 Server.

Now it does not appear that the CDONTS object is available on the 2003
Server?

Is this correct?

If so, how does one send e-mail programmatically on 2003 Server using
"Classic ASP" (not .NET). Which object do I use?

TIA
 
M

McKirahan

Paul said:
I am using the CDONTS.NewMail object to send e-mail programmatically.

We upgraded our IIS server from NT to Windows 2003 Server.

Now it does not appear that the CDONTS object is available on the 2003
Server?

Is this correct?

If so, how does one send e-mail programmatically on 2003 Server using
"Classic ASP" (not .NET). Which object do I use?

TIA

Try CDO.Message (I think).
 
D

Dr. Know

Paul said:
I am using the CDONTS.NewMail object to send e-mail programmatically.

We upgraded our IIS server from NT to Windows 2003 Server.

Now it does not appear that the CDONTS object is available on the 2003
Server?

Is this correct?

If so, how does one send e-mail programmatically on 2003 Server using
"Classic ASP" (not .NET). Which object do I use?

Hey! This is one I can answer!

This is a code snippet from a previous project - I became quite
familiar with CDOSYS when writing ACCESS Report E-Mail apps.
Replace variables appropriately.

Also, this routine uses cdoSendUsingPort, you might want to rewrite it
so that it uses the local drop directory instead. This was done for a
user who wanted to send e-mail through his local ISP account instead
of MS IIS SMTP.

Enjoy it, I've got lots of hours into figuing this stuff out!

Greg

---------------------------------------

Function SendReport( mSStr)
On Error GoTo 0
Dim mobjFlds
Dim mobjConf
Dim mobjMail
Dim strRet

strRet = ""
Set mobjConf = CreateObject("CDO.Configuration")
Set mobjFlds = mobjConf.Fields
With mobjFlds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPConnectionTimeout) = 60
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSMTPServer) = SMSERVER
.Item(cdoSMTPServerPort) = SMSERVERPORT
.Item(cdoSendUserName) = SMAUTHUSER
.Item(cdoSendPassword) = SMAUTHPASS
.Update
End With
Set mobjMail = CreateObject("CDO.Message")
mobjMail.Configuration = mobjConf
mobjMail.Fields(cdoImportance) = 1
mobjMail.Fields("urn:schemas:mailheader:X-MSMail-Priority") = 1
mobjMail.Fields("urn:schemas:mailheader:X-Mailer") = "Automated
ASP Report Mailer (c)2004 by D.G. Gillilan"
mobjMail.Fields.Update
mobjMail.From = "Mailer Daemon <" & SMEMAIL & ">"
mobjMail.To = SMEMAIL
mobjMail.ReplyTo = SMEMAIL
mobjMail.Subject = SMCOMPANY
mobjMail.AutoGenerateTextBody = False
mobjMail.MimeFormatted = False
mobjMail.TextBody = SMCOMPANY & vbCrLf & mSstr
on error resume next
mobjMail.Send
if err.number <> 0 then
Select Case err.Number
Case -2147220973
strRet = " Failure to Send Report Message -
Server Not Found" & vbCrLf & " Error: " & err.Number & " - " &
err.Description
Case -2147220975
strRet = " Failure to Send Report Message -
Server Authentication Failed" & vbCrLf & " Error: " & err.Number & "
- " & err.Description
Case Else
strRet = " Failure to Send Report Message -
Error: " & err.Number & " - " & err.Description
End Select
end if
on error goto 0
Set mobjConf = Nothing
Set mobjFlds = Nothing
Set mobjMail = Nothing
SendReport = strRet

End Function



Dr. Know
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top