Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

ASP from mailer Returns or line breaks

  • 26-10-2008 02:59PM
    #1
    Registered Users, Registered Users 2 Posts: 123 ✭✭


    Hi

    I'm working on a asp form mailer.
    It all works fine except the email that is sent has all the variables on the same line. I would like them to be on a seperate line.

    I read various different forums regarding this issue to no avail.
    It's a simple thing but its taking me far too long for a simple line break

    here is the ASP I'm using:

    <%
    Set myMail=CreateObject("CDO.Message")
    myMail.Subject= Request("subject")
    myMail.From= Request("email")
    myMail.To="myemail@myprovider.com"
    myMail.TextBody="Name:"&Request("uname")&_
    "Email:"&Request("email")&_
    "Tel:"&Request("contactno")&_
    "Address:"&Request("address")&_
    "query"&Request("query")

    myMail.Send
    set myMail=nothing
    %>


    Any help would be much appreciated


Comments

  • Registered Users, Registered Users 2 Posts: 2,699 ✭✭✭samhail


    The solution i found to this at one stage was to encode it as HTML, and then add in like <br/>'s.

    Dont have the code handy but should be handy to google. or someone have another solution ?


  • Registered Users, Registered Users 2 Posts: 123 ✭✭Clone


    Thanks for the reply,

    I tried that, but I wasn't sure If i was declaring the bodytext to be html properly so it didn't work.


  • Registered Users, Registered Users 2 Posts: 706 ✭✭✭DJB


    In plain text mails, you use vbcrlf to do a line break, e.g.

    myMail.TextBody= "Name: " & Request("uname") & vbcrlf &_
    "Email: " & Request("email") & vbcrlf &_
    "Tel: " & Request("contactno") & vbcrlf &_
    "Address: " & Request("address") & vbcrlf &_
    "query"&Request("query")


  • Users Awaiting Email Confirmation Posts: 351 ✭✭ron_darrell


    DJB has it - if you want to put HTML in the body you need to use - myMail.HTMLBody instead

    Regards,
    RD


  • Registered Users, Registered Users 2 Posts: 123 ✭✭Clone


    DJB thanks for that it worked perfect. I had been tinkering with this but never got it correct.

    ron_darrell thanks for the html definition, handy to know as i had been dealing with flash spitting out html markup in the variables but got rid of that.
    It will come in handy in the future.


  • Advertisement
Advertisement