Results 1 to 6 of 6

Thread: [RESOLVED] [2008] Email through default email package - Newline not working

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2007
    Posts
    159

    Resolved [RESOLVED] [2008] Email through default email package - Newline not working

    I am attempting to write some code that will launch the users default email application, and pre-fill the fields - To, Subject, Body

    The Process.Start command launches my copy of Outlook and successfully puts everything in the correct fields.

    The problem I am having is that the whole body appears on one line, regardless of either the 'vbCrLF' or 'Environment.Newline' or '<BR />' statements that appear.

    For example
    vb.net Code:
    1. Dim sParams As String = ""
    2.  
    3.         Dim emailto = "[email protected]"
    4.         Dim subject = "This is a subject line"
    5.         Dim body = ""
    6.  
    7.         body = Label1.Text & Environment.NewLine
    8.         body = body & Label3.Text & Environment.NewLine
    9.         body = body & Label2.Text
    10.  
    11.  
    12.         sParams = "mailto:" & emailto & "&subject=" & subject & "&body=" & body
    13.         System.Diagnostics.Process.Start(sParams)

    For info - Label2.Text contains 2 short lines of text with a vbCrLf at the end of line 1.
    Last edited by christopherpm; Jul 17th, 2008 at 05:18 PM.
    If my post helped you, please rate it. Thanks.

Posting Permissions

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



Click Here to Expand Forum to Full Width