Solved

Dynamic generate plain text email with new line

Posted on 2009-04-05
3
689 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
3 Comments
 
LVL 51

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

679 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