Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2003
    Posts
    21

    Unanswered: Newline characters in mail content

    I wish to send an email, and I want the ability to place explicit newline characters in the content (bodyText) of the mail.

    I have tried both br and backslash-n. In both cases, instead of being interpreted as a newline character, they appear literally.

    Thank you in advance for solutions.

    For futher clarification, here is my code. All works fine except for the newline problem:

    set Mailer = Server.CreateObject("SMTPsvg.Mailer")
    Mailer.RemoteHost = "kabbalaonline.org"
    Mailer.FromName = "tom"
    Mailer.FromAddress = "tom@mail.com"
    Mailer.AddRecipient "joe", "joe@mail.com"
    Mailer.Subject = "hello, joe"
    Mailer.BodyText = "this is line 1<br>this is line2"
    if Mailer.SendMail then
    Response.Write("ok")
    else
    Response.Write("Mailer.Response")
    end if
    set Mailer = nothing

  2. #2
    Join Date
    Mar 2003
    Location
    Atlanta, GA
    Posts
    191
    Try this...

    I believe the mailer component you're using defaults to plain text content if not otherwise specified.

    For text emails, you can try:

    "this is line 1" & VbCrLf & "this is line2"

    For html email, a <br> should work... you just need to specify the email to be html content...

    Mailer.ContentType = "text/html" OR Mailer.ContentType = "text/plain"

    Cheers...

    Tim
    Tim

  3. #3
    Join Date
    Apr 2003
    Posts
    21
    Thank you very much.

Posting Permissions

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