473,326 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

trying to seperate my string with a space, html, or something ??

29
Can someone tell me how to manipulate my body string so that when the user semds the email, the info that was in the textboxes are on different lines.

ex.

trying to get this:
Sam doe
1234 lemon st
New Orleans, LA

instead of like this:
Sam doe 1234 lemon st New Orleans, LA

Expand|Select|Wrap|Line Numbers
  1.     Inherits System.Web.UI.Page
  2.  
  3.     Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.FinishButtonClick
  4.         Dim body As String
  5.         body = txtComments.Text & _
  6.         txtStreet.Text & _
  7.         txtCity.Text
  8.         SendMail(txtEmail.Text, body)
  9.     End Sub
  10.  
  11.     Private Sub SendMail(ByVal from As String, ByVal body As String)
  12.         Dim mailServerName As String =
  13.         Dim message As MailMessage = New MailMessage(from, "a@ra.com", "feedback", body)
  14.         Dim mailClient As SmtpClient = New SmtpClient
  15.  
  16.         mailClient.Host = mailServerName
  17.         mailClient.Send(message)
  18.         message.Dispose()
  19.     End Sub
  20.  
Thanks in advance
Feb 27 '08 #1
3 1156
jeffstl
432 Expert 256MB
You will want to use the .NET equivalent of the old vbCrLf or carriage return.
ControlChars.CrLf will place a new line in between strings
Like this:

Expand|Select|Wrap|Line Numbers
  1. Inherits System.Web.UI.Page
  2.  
  3.     Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArg  s) Handles Wizard1.FinishButtonClick
  4.         Dim body As String
  5.         body = txtComments.Text & ControlChars.CrLf & txtStreet.Text & ControlChars.CrLf & txtCity.Text
  6.         SendMail(txtEmail.Text, body)
  7.     End Sub
  8.  
  9.     Private Sub SendMail(ByVal from As String, ByVal body As String)
  10.         Dim mailServerName As String =
  11.         Dim message As MailMessage = New MailMessage(from, "a@ra.com", "feedback", body)
  12.         Dim mailClient As SmtpClient = New SmtpClient
  13.  
  14.         mailClient.Host = mailServerName
  15.         mailClient.Send(message)
  16.         message.Dispose()
  17.     End Sub
  18.  
  19.  
Feb 27 '08 #2
cluce
29
great. thanx a million
Feb 27 '08 #3
Killer42
8,435 Expert 8TB
...(from, "a@ra.com", "feedback", body)
I just wanted to check, is that a real e-mail address? If so, I'll blank it out. Scammers and spammers regularly scan forums such as this looking for victims, and we don't like to help them.
Feb 28 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ed Swartz | last post by:
All of a sudden this morning my ASP files started generating the error: Out of String Space: 'Replace' These script files have been running just fine for several weeks with no problems. I did...
8
by: Ronald | last post by:
Hi there! Sometimes I am getting the errormessage "Out of string space ". The error occurs on this code: sBrf = sBrf & sBodyTmp & "\par \page \par " When this occurs len(sBrf)<100.000 and...
39
by: hpy_awad | last post by:
I know that group is for C not for C++ but please try to help me , How can I declare size of an array as variable value came from screen? #include "iostream.h" #include "iomanip.h" #include...
4
by: B Squared | last post by:
I'm trying to pass a string from the current html page to one I'm calling. I've read (in the O'Reilly text) this involves using "?", but there's no example. For example, given I have a standard...
2
by: ckseng11 | last post by:
Hi everyone, I had a problem that happen once only but i do not want it to repeat again. It happen when i retrieve data from my database. The process can't complete and show error 14, Out of...
2
by: csgraham74 | last post by:
Hi, I have a requirement in work that i give a person the ability to create a html document using a richt text editor. What i then want to do is save the HTML doct to my server & insert...
6
by: Dennis | last post by:
Is there anything built in to vb.net that will take a plain text string and reformat it as HTML? What I mean is: o replace newlines with <BR> o replace " with &quot; o etc. I am using vb.net...
2
by: lpc403 | last post by:
New to Java (and programming in general) and trying to accept a sentence from the command line to count the consonants, vowels, and punctuation. What code do I need to perform the following? 1)...
11
by: lee weaver | last post by:
For some reason when applyinf a filter, not changeing or adding information to my database i get a 3022 error. here is the offending code. Private Sub Updatebutton() Dim f As String ...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.