Solved

Dynamic generate plain text email with new line

Posted on 2009-04-05
3
693 Views
Last Modified: 2012-05-06
Hi, i would like to generate plain text email dynamically from a string. Because the website email seen not to render the html code.

i try this but seen not success, expert please advice me.TQ

the result go to:

Reservation request to RJ Hotel Kulai - 05/04/2009 18:33:13vbcr --------------------------------------vbcrArrive: 15-04-2009vbcrDepart: 17-04-2009vbcrGuest: 1vbcrName: testvbcrGender: MalevbcrIc/PassporttestvbcrPhone: testvbcrFax: testvbcrEmail: leppon888@hotmail.comvbcrCountry: testvbcrCity: testvbcrAddress: testvbcr --------------------------------------vbcr

( there is no line break... ) wha's wrong.
Dim strCustomer As String = "Reservation request to " & ddlDepartments.SelectedItem.Text & " - " & DateTime.Now & "vbcr" & " --------------------------------------" & "vbcr" & _
            "Arrive: " & txtArrive.Text & "vbcr" & _
            "Depart: " & txtDepart.Text & "vbcr" & _
            "Guest: " & ddlGuest.SelectedValue & "vbcr" & _
            "Name: " & txtName.Text & "vbcr" & _
            "Gender: " & ddlGender.SelectedValue & "vbcr" & _
            "Ic/Passport" & txtIc.Text & "vbcr" & _
            "Phone: " & txtPhone.Text & "vbcr" & _
            "Fax: " & txtFax.Text & "vbcr" & _
            "Email: " & txtEmail.Text & "vbcr" & _
            "Country: " & txtCountry.Text & "vbcr" & _
            "City: " & txtCity.Text & "vbcr" & _
            "Address: " & txtAddress.Text & "vbcr" & " --------------------------------------" & "vbcr"

Open in new window

0
Comment
Question by:john8098
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 52

Accepted Solution

by:
Ryan Chong earned 125 total points
ID: 24074097
try " & vbCr & " instead of " & "vbcr" & _ ":

Dim strCustomer As String = "Reservation request to " & ddlDepartments.SelectedItem.Text & " - " & DateTime.Now & vbCr & _
            "--------------------------------------" & vbCr & _
            "Arrive: " & txtArrive.Text & vbCr & _
            "Depart: " & txtDepart.Text & vbCr & _
            "Guest: " & ddlGuest.SelectedValue & vbCr & _
            "Name: " & txtName.Text & vbCr & _
            "Gender: " & ddlGender.SelectedValue & vbCr & _
            "Ic/Passport" & txtIc.Text & vbCr & _
            "Phone: " & txtPhone.Text & vbCr & _
            "Fax: " & txtFax.Text & vbCr & _
            "Email: " & txtEmail.Text & vbCr & __
            "Country: " & txtCountry.Text & vbCr & _
            "City: " & txtCity.Text & vbCr & _
            "Address: " & txtAddress.Text & vbCr & " --------------------------------------" & vbCr
0
 
LVL 2

Expert Comment

by:asmyatt
ID: 24077258
Try Constants.vbCr or use Enviroment.NewLine. I code in C# for asp.net and use Enviroment.NewLine.
0
 

Author Closing Comment

by:john8098
ID: 31566852
Good
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question