manared
Well-known member
- Joined
- Jun 1, 2006
- Messages
- 84
- Programming Experience
- 1-3
I'm using vb.net 2005 and I have a multiline textbox where users enter an address. This textbox has up to 6 lines of text. The user can click a button to email of the information on the form to someone. Right now I am just using the textbox name.text in an html formatted email. How would I go about keeping those enters/line feeds in the email?
Here are some code snippets:
Here are some code snippets:
VB.NET:
eMsg += "<td width=300 valign='top'>To: " & txtAddress.Text
VB.NET:
Dim Emessage As String = eMsg.ToString.Trim
Try
Dim objMail As New System.Net.Mail.MailMessage(Efrom, Eto, Esubject, Emessage)
Dim filename As String = ""
Dim y As Integer = 0
For y = 0 To dset.Tables(0).Rows.Count - 1
If dset.Tables(0).Rows(y).Item(6).ToString = "" Then
'do nothing, move on
Else
filename = dset.Tables(0).Rows(y).Item(6).ToString.Trim
objMail.Attachments.Add(New System.Net.Mail.Attachment(filename))
End If
Next
objMail.IsBodyHtml = True
objMail.Priority = Net.Mail.MailPriority.Normal
Dim objSMTP As New System.Net.Mail.SmtpClient("serverName")
objSMTP.Send(objMail)
Catch ex As Exception
MsgBox(ex.ToString)
End Try