Solved

Dynamic generate plain text email with new line

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…
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…

705 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

19 Experts available now in Live!

Get 1:1 Help Now