[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Multi-line bodies using asp.net and mailmessage

Posted on 2009-07-02
2
Medium Priority
?
550 Views
Last Modified: 2012-05-07
I'm having web visitors fill out a form, and then want to email the data from that form to someone else.    My problem is that I can only make the body so long before the message doesn't get sent.  I'm figuring there must be some sort of string size limit to the body.  Can anyone tell me how I can load a large amount of text on the body
Dim eMessage As New MailMessage()
        eMessage.From = New System.Net.Mail.MailAddress(TextBoxEmail.Text)
        eMessage.To.Add(New System.Net.Mail.MailAddress("randy@tradewinds-software.com"))
        eMessage.Subject = "Lava Lava Registration Form"
        eMessage.Body = "Name: " + TextBoxName.Text + Chr(13) + "Address: " + TextBoxAddress.Text + Chr(13) + "City:" + TextBoxCity.Text + Chr(13) + "State:" + TextBoxState.Text + Chr(13) + "Zip:" + TextBoxZip.Text + Chr(13) + "Home Telephone:" + TextBoxHomeTelephone.Text + Chr(13) + "Email:" + TextBoxEmail.Text + Chr(13) + "Date of Birth:" + TextBoxDateOfBirth.Text + Chr(13) + "Age:" + TextBoxAge.Text + Chr(13) + "Last Grade Completed:" + TextBoxLastGradeCompleted.Text + Chr(13) + "Emergency Contact:" + TextBoxEmergencyContact.Text + Chr(13) + "Mother:" + TextBoxMother.Text + Chr(13) + "Father:" + TextBoxFather.Text + Chr(13) + "Other:" + TextBoxOther.Text + Chr(13) + "Allergies and Medical Conditions:" + TextBoxAllergies.Text + Chr(13) + "Home Church:" + TextBoxHomeChurch.Text + Chr(13) + "Name of Special Friend:" + TextBoxNameOfFriend.Text + Chr(13)

Open in new window

0
Comment
Question by:Randy Rich
[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
2 Comments
 
LVL 3

Accepted Solution

by:
dipakdave1983 earned 2000 total points
ID: 24770147
there is newline contant for c#   if your email type is "plain"
 Environment.NewLine


if you are specifying mail type = html then u have to use "<br>" in the message for new line...
0
 

Author Comment

by:Randy Rich
ID: 24772555
That still doesn't work.  It only works if I send a portion of it.
 

Here's the code that doesn't work
 
 
eMessage.IsBodyHtml = True 
eMessage.Body = "Name: " + TextBoxName.Text + "<br>" + "Address: " + TextBoxAddress.Text + "<br>" + "City:" + TextBoxCity.Text + "<br>" + "State:" + TextBoxState.Text + "<br>" + "Zip:" + TextBoxZip.Text + "<br>" + "Home Telephone:" + TextBoxHomeTelephone.Text + "<br>" + "Email:" + TextBoxEmail.Text + "<br>" + "Date of Birth:" + TextBoxDateOfBirth.Text + "<br>" + "Age:" + TextBoxAge.Text + "<br>" + "Last Grade Completed:" + TextBoxLastGradeCompleted.Text + "<br>" + "Emergency Contact:" + TextBoxEmergencyContact.Text + "<br>" + "Mother:" + TextBoxMother.Text + "<br>" + "Father:" + TextBoxFather.Text + "<br>" + "Other:" + TextBoxOther.Text + "<br>" + "Allergies and Medical Conditions:" + TextBoxAllergies.Text + "<br>" + "Home Church:" + TextBoxHomeChurch.Text + "<br>" + "Name of Special Friend:" + TextBoxNameOfFriend.Text + "<br>" 
 
Here's the code that does work, but doesn't contain everything I want to send
 
 eMessage.IsBodyHtml = True 
eMessage.Body = "Name: " + TextBoxName.Text + "<br>" + "Address: " + TextBoxAddress.Text 

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

650 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