line feeds in email using vb.net and iframes

manared

Well-known member
Joined
Jun 1, 2006
Messages
84
Programming Experience
1-3
I have a web form that whatever material the user inputs is sent through email. I am using vb.net and the program folders are placed in an iframe to actually be put out on the web. When the email is sent, I want line feeds or carriage returns. The way my program is now, it works when I run the program, the email has the line breaks where I want them. When we put the program out on the web through the iframe, everything runs all together and there are no line feeds at all. Is there something going on through the iframe or something that it loses those returns? If I have to put in <BR> tags, where and how do I put them in, or are there any other suggestions for getting the line feeds to work?
Here is my vb.net code:

SendMail(txtEmail.Text, "Literature on the following equipment/services have been requested: " & vbCrLf & _
EquipList & vbCrLf & vbCrLf & "<BR>" & _
"Information needed for " & ddlStatus.SelectedValue & vbCrLf & vbCrLf & _
material & vbCrLf & _
primary & vbCrLf & _
"Heard about FEECO through " & ddlReffered.SelectedValue & vbCrLf & _
comments & vbCrLf & vbCrLf & _
"-------------------------------------------------------------------" & vbCrLf & _
txtName.Text & vbCrLf & _
txtCompany.Text & vbCrLf & _
txtTitle.Text & vbCrLf & _
txtAddress.Text & vbCrLf & _
txtAddAddress.Text & vbCrLf & _
city & ddlState.SelectedValue & " " & txtZip.Text & vbCrLf & _
ddlCountry.SelectedValue & vbCrLf & _
txtEmail.Text & vbCrLf & _
"Phone: " & txtPhone.Text & vbCrLf & _
"Fax: " & txtFax.Text)

which calls this

Private Sub SendMail(ByVal from As String, ByVal body As String)
Dim mailServerName As String = "exchange.feeco.com"
Dim message As MailMessage = New MailMessage(from, "aredmann@feeco.com", "Requested Literature", body)
' Will be sent to sales@feeco.com
Dim mailClient As SmtpClient = New SmtpClient
mailClient.Host = mailServerName
mailClient.Send(message)
message.Dispose()
End Sub
Thank you for any help.
 
I did try that because that's what I thought may work, but it doesn't.

Problem is solved though. I put all of the body stuff into a variable before calling SendMail and just put the variable into the SendMail function. Now it works just fine.
 
Back
Top