IIS and SMTP - CDONTS code from IIS 5.0 in IIS 5.1

This is Interesting: Free IT Magazines  
Home > Archive > IIS and SMTP > January 2004 > CDONTS code from IIS 5.0 in IIS 5.1





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author CDONTS code from IIS 5.0 in IIS 5.1
Brian

2004-01-24, 2:06 am

I had an emailing VBscript/ASP code that worked perfectly
fine under IIS 5.0 (Win2K pro). Upon upgrading to IIS 5.1
(WinXP Pro), the same script no longer worked. I tried
registering the "smtp_cdonts.dll" from the Win2K machine
in XP ("send to" regsvr32.exe) but it still doesn't work.
Any help would be greatly appreciated. Thanks in advance.
See script below:

'Generate Email
dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")

'email properties
objCDO.To = emailArray
objCDO.To = email_array
objCDO.From = emailSender
objCDO.Subject = msg_subject
objCDO.TextBody = msg_body
objCDO.Importance = 2 '1=lowest 3=highest?

objCDO.Send 'Actually Send the email

'Cleanup
Set objCDO = Nothing
Kristofer Gafvert

2004-01-24, 2:06 am

The error description "it doesn't work", is not very informative. Could you
please tell us what happens, any error message, or anything else that might
help us help you?

--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but please
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003


"Brian" <anonymous@discussions.microsoft.com> wrote in message
news:004801c3dddc$5e48aa70$a101280a@phx.gbl...
quote:

> I had an emailing VBscript/ASP code that worked perfectly
> fine under IIS 5.0 (Win2K pro). Upon upgrading to IIS 5.1
> (WinXP Pro), the same script no longer worked. I tried
> registering the "smtp_cdonts.dll" from the Win2K machine
> in XP ("send to" regsvr32.exe) but it still doesn't work.
> Any help would be greatly appreciated. Thanks in advance.
> See script below:
>
> 'Generate Email
> dim objCDO
> Set objCDO = Server.CreateObject("CDONTS.NewMail")
>
> 'email properties
> objCDO.To = emailArray
> objCDO.To = email_array
> objCDO.From = emailSender
> objCDO.Subject = msg_subject
> objCDO.TextBody = msg_body
> objCDO.Importance = 2 '1=lowest 3=highest?
>
> objCDO.Send 'Actually Send the email
>
> 'Cleanup
> Set objCDO = Nothing




Alex Feinman [MVP]

2004-01-24, 2:06 am

CDONTS does not exist on IIS 5.1 and above. In IIS 5.0 (Windows 2000) it was
deprecated and existed for compatibility only - to help migrate legacy NT
4.0 code.

You are not allowed by your OS license to copy OS components between
operating systems.

Instead of CDONTS.NewMail use CDO.Message. This interface is supported on
all operating systems from Windows 2000 to Windows 2003.

'Generate Email
dim objCDO
Set objCDO = Server.CreateObject("CDO.Message")

'email properties
objCDO.To = emailArray
objCDO.From = emailSender
objCDO.Subject = msg_subject
objCDO.TextBody = msg_body
'objCDO.Importance = 2 '1=lowest 3=highest?
objCDO.Fields("urn:schemas:httpmail:priority") = 1
objCDO.Send 'Actually Send the email

'Cleanup
Set objCDO = Nothing


Note that CDOSYS unlike CDONTS allows you to specify many more SMTP
parameters, use SMTP protocol or a pickup directory method, create
attachments, HTML emails etc.

For more information see
http://msdn.microsoft.com/library/d...ng_messages.asp

Keep in mind that in order to use constants like
cdoDispositionNotificationTo or cdoSendUsingMethod you need to either
include a reference to an appropriate type library or define the required
constants yourself


"Brian" <anonymous@discussions.microsoft.com> wrote in message
news:004801c3dddc$5e48aa70$a101280a@phx.gbl...
quote:

> I had an emailing VBscript/ASP code that worked perfectly
> fine under IIS 5.0 (Win2K pro). Upon upgrading to IIS 5.1
> (WinXP Pro), the same script no longer worked. I tried
> registering the "smtp_cdonts.dll" from the Win2K machine
> in XP ("send to" regsvr32.exe) but it still doesn't work.
> Any help would be greatly appreciated. Thanks in advance.
> See script below:
>
> 'Generate Email
> dim objCDO
> Set objCDO = Server.CreateObject("CDONTS.NewMail")
>
> 'email properties
> objCDO.To = emailArray
> objCDO.To = email_array
> objCDO.From = emailSender
> objCDO.Subject = msg_subject
> objCDO.TextBody = msg_body
> objCDO.Importance = 2 '1=lowest 3=highest?
>
> objCDO.Send 'Actually Send the email
>
> 'Cleanup
> Set objCDO = Nothing




Kristofer Gafvert

2004-01-24, 2:06 am

Alex,

Do you know if it is allowed or not to copy cdonts.dll? First it was not
allowed, then i was told that it was okay, and they even had a page
explaining how to copy the file and register it on the new machine (Windows
Server 2003). But now that page is removed, so i'm starting to wonder if it
is not allowed once again.

--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but please
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003


"Alex Feinman [MVP]" <public_news@alexfeinman.com> wrote in message
news:%23BXfAwh3DHA.3916@TK2MSFTNGP11.phx.gbl...
quote:

> CDONTS does not exist on IIS 5.1 and above. In IIS 5.0 (Windows 2000) it


was
quote:

> deprecated and existed for compatibility only - to help migrate legacy NT
> 4.0 code.
>
> You are not allowed by your OS license to copy OS components between
> operating systems.
>
> Instead of CDONTS.NewMail use CDO.Message. This interface is supported on
> all operating systems from Windows 2000 to Windows 2003.
>
> 'Generate Email
> dim objCDO
> Set objCDO = Server.CreateObject("CDO.Message")
>
> 'email properties
> objCDO.To = emailArray
> objCDO.From = emailSender
> objCDO.Subject = msg_subject
> objCDO.TextBody = msg_body
> 'objCDO.Importance = 2 '1=lowest 3=highest?
> objCDO.Fields("urn:schemas:httpmail:priority") = 1
> objCDO.Send 'Actually Send the email
>
> 'Cleanup
> Set objCDO = Nothing
>
>
> Note that CDOSYS unlike CDONTS allows you to specify many more SMTP
> parameters, use SMTP protocol or a pickup directory method, create
> attachments, HTML emails etc.
>
> For more information see
>


http://msdn.microsoft.com/library/d...ng_messages.asp
quote:

>
> Keep in mind that in order to use constants like
> cdoDispositionNotificationTo or cdoSendUsingMethod you need to either
> include a reference to an appropriate type library or define the required
> constants yourself
>
>
> "Brian" <anonymous@discussions.microsoft.com> wrote in message
> news:004801c3dddc$5e48aa70$a101280a@phx.gbl...
>
>




Alex Feinman [MVP]

2004-01-24, 2:06 am

No, I don't. I don't even remember this page being available. Sorry.

"Kristofer Gafvert" <kgafvert@NEWSilopia.com> wrote in message
news:Oum2rAm3DHA.3140@tk2msftngp13.phx.gbl...
quote:

> Alex,
>
> Do you know if it is allowed or not to copy cdonts.dll? First it was not
> allowed, then i was told that it was okay, and they even had a page
> explaining how to copy the file and register it on the new machine


(Windows
quote:

> Server 2003). But now that page is removed, so i'm starting to wonder if


it
quote:

> is not allowed once again.
>
> --
> Regards,
> Kristofer Gafvert - IIS MVP
> Reply to newsgroup only. Remove NEWS if you must reply by email, but


please
quote:

> do not.
> www.ilopia.com - FAQ and Tutorials for Windows Server 2003
>
>
> "Alex Feinman [MVP]" <public_news@alexfeinman.com> wrote in message
> news:%23BXfAwh3DHA.3916@TK2MSFTNGP11.phx.gbl...
> was
NT[QUOTE][color=darkred]
on[QUOTE][color=darkred]
>


http://msdn.microsoft.com/library/d...ng_messages.asp
quote:

required[QUOTE][color=darkred]
>
>




Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com