Skip Ribbon Commands
Skip to main content
SharePoint

New setup when you use web forms to send mail.

All web pages needs to be modified like the second example to be valid on the new webserver.

Old Setup
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = "webserver@sun.ac.za"
objNewMail.To = "email address"
objNewMail.Subject = "Subject"
objNewMail.Body = BODY
objNewMail.BodyFormat = 0
objNewMail.MailFormat = 0
objNewMail.Importance = CdoNormal
objNewMail.Send
Set objNewMail = Nothing
New Setup
Modify the following values:

.To = "Recipient EmailAddress"
.Subject = "Subject of mail message"
 

Set objErrMail= Server.CreateObject("CDO.Message")
With objErrMail
.From = "webserver@sun.ac.za"
.To = "email address"
.Subject = "Subject"
.HTMLBody = BODY
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.sun.ac.za"
.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Configuration.Fields.Update
.Send
End With