Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

ASP from mailer Returns or line breaks

  • 26-10-2008 1: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