Hi all!! Im trying to convert my CDONTS code to CDOSYS because we just converted to Windows Server 2003. Below is the code that I've changed based on research. I am not really a programmer, but I think I followed all the instructions as accurately as I can. Can you guys take a look and let me know what I am doing wrong. Thanks!
Dim objCDOSYSMail
Dim objConf
Dim strFrom
Dim strTo
Dim strCc
Dim strBcc
Dim strSubject
Dim strBody
strFrom=Request.Form("ReqEmail")& "@advocatehealth.com"
strTo="
[email protected]"
strSubject = "Research Request Confirmation Page"
strBody="The following information was submitted:" & Chr(13) & Chr(13)
If Trim(Request.Form("Contact_FullName"))<>"" Then
strBody = strBody & "Requestor's Name: " & Request.Form("Contact_FullName") & Chr(13)
End If
If Trim(Request.Form("Site"))<>"" Then
strBody = strBody & "Site: " & Request.Form("Site") & Chr(13)
End If
Note: This goes on until the last of the fields - I cut the rest of it to make it shorter.
strBody = strBody & Chr(13) & Chr(13) & "Thank you for submitting your data."
strCc=Request.Form("VPEMail") & "@advocatehealth.com"
strBcc=Request.Form("ReqEmail") & "@advocatehealth.com"
Set objConf = Server.CreateObject("CDO.Configuration")
Const cdoSendUsingPort = 25
Dim objFields
Set objFields = objconf.Fields
objFields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
objFields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "moat.advocatehealth.com"
objFields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
objFields.Update
Set objCDOSYSMail.Configuration = objConf
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
objCDOSYSMail.From=strFrom
objCDOSYSMail.To=strTo
objCDOSYSMail.Cc=strCc
objCDOSYSMail.Bcc=strBcc
objCDOSYSMail.Subject=strSubject
objCDOSYSMail.TextBody=strBody
objCDOSYSMail.Send
Set objCDOSYSMail = Nothing
Set objConf = Nothing
Set objFields = Nothing
%>
<p><b>Thank you for submitting your
Research Request!<br>
</b>You will receive an e-mail
shortly. The e-mail was sent using the following information:</p>
<b>Sent To: <% '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%
Response.Write Request.Form("ReqEmail") & "@advocatehealth.com"
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%
%>
<br>
From : Research Team
<p>Subject: Research Request Confirmation Page</p>
<p>Content: <% '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%
' Call the ParseBody function and pass the strBody string to it.
' This will replace the Chr(13) characters with <br> tags in the HTML.
Response.Write(ParseBody(strBody))
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%
%>
</p>
<p> </p>
</b>