I’m using this server object to send emails to my account from data put into a form. When I set the Mailer properties to text/html all works and I can code in html but I can’t create line breaks after my form requests & VBCrLf wont work because I’m formating in html. What to do.
Set Mailer = Server.CreateObject(“SMTPsvg.Mailer”)
Mailer.FromName = Request.Form ("from")
Mailer.FromAddress= Request.Form("email address")
Mailer.RemoteHost = "privacy"
Mailer.AddRecipient "privacy"
Mailer.Subject = "Web Site"
sBodyText = "The following is feedback from my web site." & VBCrLf
sBodyText = sBodyText & "Favorite color Is " & Request.Form("color")& VBCrLf
sBodyText = sBodyText & "The gender is " & Request.Form("gender")& VBCrLf
sBodyText = sBodyText & "" & request.form("comments")
Mailer.BodyText = sBodyText
Mailer.SendMail
Response.redirect "privacy.asp"
Response.end
This works. Below is the code with the HTML
Set Mailer = Server.CreateObject(“SMTPsvg.Mailer”)
Mailer.FromName = Request.Form ("from")
Mailer.FromAddress= Request.Form("email address")
Mailer.RemoteHost = "privacy"
Mailer.AddRecipient "privacy"
Mailer.Subject = "Web Site"
sBodyText = "<b>The following is feedback from my web site.</b><br>"
sBodyText = sBodyText & "<b>Favorite color Is </b>" & Request.Form("color")<br>
sBodyText = sBodyText & "<b>The gender is</b> " & Request.Form("gender")<br>
sBodyText = sBodyText & "" & request.form("comments")
Mailer.ContentType = "text/html"
Mailer.BodyText = sBodyText
Mailer.SendMail
Response.redirect "privacy.asp"
Response.end
With the <br> an error is produced. Without it the form works but the text is in one long line when it comes to the part with the Request.Form. What to do? Forget the html formatting?:pope: