New Line at an email-body using CDONTS

Results 1 to 3 of 3

Thread: New Line at an email-body using CDONTS

  1. #1
    Mathias Vissers Guest

    Default New Line at an email-body using CDONTS

    Hello,<BR><BR>I made a form and an auto-replyer. When somebody fill in the form, an asp-script using CDONTS sends an reply-email.<BR>I used:<BR><BR>Dim txtSubject<BR>txtSubject = "my text"<BR>objCDO.Body = txtSubject<BR><BR>But how can I start a new line in my message? <BR><BR>Thanx!

  2. #2

    Default CROSSPOST


  3. #3
    Join Date
    Dec 1969

    Default RE: New Line at an email-body using CDONTS

    Very simple. Use " Chr(10) " which is the ASCII value for linefeed.<BR><BR>...But then... What if you&#039re getting your data/text from a Request.Form (i.e.: a text field or a textarea). In such a case <BR>you can use a formula something as the follows:<BR><BR>&#060;%<BR>Dim MyText<BR>MyText = Request.Form("TextareaField")<BR>Dim arrayText<BR>arrayText = split(MyText,Chr(10))<BR>For x = LBound(arrayText) to UBound(arrayText)<BR>FormattedText = FormattedText+arrayText(x)+Chr(10)<BR>Next<BR>objC DO.Body = FormattedText<BR>%&#062;<BR><BR>You can also try something more complex such as creating a formula to insert a linefeed after every 3 sentences similar to the example above.<BR><BR>Disclaimer: I never tried this (and it may not work in all browsers since each browser can encode a textare field differently). I just thought of this at the spur of this moment just to give you an illustration.<BR>but (I hope) you get the picture!<BR><BR>Aaron<BR><BR>P.S.: If time permits you: Please see my CreateObject CDONT problem below or refer someone to it.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts