I’m having trouble sending my emails in an html format using CDOSYS, it sends fine in text…my code is below
<%
Option Explicit
dim sFname, sEmail, sMessage, sAddress, sPhone, sLoan, sLname
dim oCdoMail, oCdoConf, sConfURL
sFname = Request.Form("fname")
sLname = Request.Form("lname")
sEmail = Request.Form("email")
sPhone = Request.Form("phone")
sAddress = Request.Form("address")
sLoan = Request.Form("loan")
sMessage = Request.Form("comments")
Set oCdoMail = Server.CreateObject("CDO.Message")
Set oCdoConf = Server.CreateObject("CDO.Configuration")
sConfURL = "http://schemas.microsoft.com/cdo/configuration/"
with oCdoConf
.Fields.Item(sConfURL & "sendusing") = 2
.Fields.Item(sConfURL & "smtpserver") = "relay-hosting.secureserver.net"
.Fields.Item(sConfURL & "smtpserverport") = 25
.Fields.Update
end with
with oCdoMail
.To = "test@home.com"
.From = "test@home.com"
.Subject = "Contact From "
'.TextBody = sMessage
.HTMLBody = "<html><body>Name: '"& sFname"'   '"& sLname"' Email '"& sEmail"' Phone: '"& sPhone"' Address: '"& sAddress"' Loan Amount: '"& sLoan"' Message: '"& sMessage"' </body></html> "
.Configuration = oCdoConf
.Send
end with
Set oCdoConf = Nothing
Set oCdoMail = Nothing
%>
I’m trying to separate the different form elements ( First Name, Last Name etc…) when I send them in plain text it comes out as one long line, but when I send it as html I get a 500 - Internal server error.
I’m new to coding so any help would be appreciated
Thank you