Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2005
    Thanked 0 Times in 0 Posts

    ASPmail and line breaks help needed

    When I use the following code to send my form results via email (from http://www.serverobjects.com/comp/Aspmail3.htm) - it works great when I get it with line breaks for each form item, however, when my client gets the email - there are no line breaks - just a blob of information. I use EudoraPro - he uses Outlook. Help - I don't understand why it is working in one and not the other. Is there another way to get the information emailed in a neat and readable format? I appreciate any insight you can provide.
    (Server uses ASPMail 3.x)

    Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
    Mailer.AddRecipient "XYZ Company", "email@123.com"
    Mailer.RemoteHost = "mail.123.com"
    Mailer.Subject = "Survey"
    Mailer.FromAddress = Request.Form("Email")
    strMsgHeader = "Form Information Follows: " & vbCrLf
    for i = 1 to Request.Form.Count
    strMsgInfo = strMsgInfo & Request.Form.Key(i) & " - " & Request.Form.Item(i) & vbCrLf
    strMsgFooter = vbCrLf & "End of form information"
    Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter

    if Mailer.SendMail then
    Response.Write "Mail sent..."
    Response.Write "Mail send failure. Error was " & Mailer.Response
    end if

  • #2
    New Coder
    Join Date
    Jun 2003
    Thanked 0 Times in 0 Posts
    I had similar problem in asp.net, so I'm guessing -
    if Mailer has BodyFormat property, then use HTML format instead of plain Text and replace all VbCrLf with "<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