Solved

Dynamic generate plain text email with new line

Posted on 2009-04-05
3
676 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 49

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

895 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now