When you think ASP, think...
logo
spgif
search
spgif
site-index
spgif
Recent Articles xml
All Articles
ASP.NET Articles
ASPFAQs.com
Related Web Technologies
User Tips!
Coding Tips
spgif
spgif spgif
spgif

leftnav-resources
spgif
Sections:
Sample Chapters
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Security
Stump the SQL Guru!
XML Info
Information:
Feedback
Author an Article
spgif
spgif spgif
ASP ASP.NET ASP FAQs Feedback topnav-right
right-bg
Print this page.
Displaying Line Breaks in an Email
By Rob Taylor


Wondering how you insert line breaks into your email's text? Use vbCrLf everywhere you need a line break! This code example shows how!

<%
  Dim objMail
  Set objMail = Server.CreateObject("CDONTS.NewMail")
  
  EM = request.form("email")
  reply = "Reply TO "
  
     objMail.From = reply
     objMail.Subject = "Line breaks in CDONTS from ASPadvice"
     objMail.To = "you@yourhouse.com

     objMail.Body = "This is the body of the " & vbcrlf&_
     "message. Sometimes the body of the " & vbcrlf&_
     "message gets very long " & vbcrlf&_
     "so you need TO put line breaks in. " & vbcrlf&_
     "Sometimes you want TO add many line " & vbcrlf&_
     "breaks like this " & vbcrlf  & vbcrlf & vbcrlf&_
     "Now we are way down here." 
      objMail.Send
 
  Response.write("Mail was Sent")
 
 'You must always do this with CDONTS.
  set objMail = nothing
%>

FAQ Table of Contents   Sending a User's Feedback to the Webmaster in an Email Sending HTML-Formatted Email 


ASP.NET [1.x] [2.0] | ASPFAQs.com | Advertise | Feedback | Author an Article