Products/Services Website Design DNN Web Hosting Bespoke Software Solutions
Spotlight Business Made Simple Credica Wilson Chauffeur Services Lysander Whitegrove FC Ultramagic Bracklesham Boardriders Johns Motors
DotNetNuke Modules janet.Articles janet.ReferMe! janet.Menu janet.Gallery janet.Guestbook janet.GoogleAds janet.Marquee
DotNetNuke Skins janet.VeniceGrandCanal janet.ParisSkyline janet.ColourBar
Articles HTML Javascript ASP .net DotNetNuke Web Robots
The implementation of the CDONTs e-mail method used in asp has changed in Windows 2003 server.
Example old CDONTS implementation
Set m1 = CreateObject("CDONTS.NewMail")m1.From = fromAddrm1.To = recipientsm1.Subject = subjectm1.Body = CStr("" & body)m1.Send
The code below is an example of the new cdo format.
Set objErrMail= Server.CreateObject("CDO.Message")With objErrMail.From = fromAddr.To = recipients.Subject = subject.HTMLBody = CStr("" & body).Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "myWebServer.com".Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25.Configuration.Fields.Update.SendEnd With
Note the sendusing schema has options as follows:
In our experience a value of 1 is simpler to configure.
The code below has been used to send e-mails via a remote SMTP server. Note the first line omits the word "server" as this is run as a local vbscript.
Set objErrMail=CreateObject("CDO.Message")With objErrMail.From = myaddress@myaddress.com.To = myfriend@hisaddress.com.Subject = "Type in your subject here".HTMLBody = "<h1> Type in the body of your message here </h1>".Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'use 1 for local or 2 for remote smtp server.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.myserveraddress.com" 'enter your smtp server.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 'port number 25 is standard.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'use 0 for no auth, 1 for basic.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "myusername" ' enter your email username.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword" 'enter email password.Configuration.Fields.Update.SendEnd With
NAT January 2007 (Revised)
Copyright © 2004-2007 Janet Systems Ltd.
DotNetNuke Website design and hosting from £15.00 per month. More...
Looking for a website design company in the Thames Valley, call us on 01628 566178
DotNetNuke ModulesDotNetNuke Skins
from Janet Systems