Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

web.mail + vbcrlf problem!

Status
Not open for further replies.

Lbob

Programmer
May 23, 2003
157
0
0
GB
Hi

On the confirmation of a booking, I'm sending an email using web.mail, however, I've got a bit of a problem with it. I'm returning a block of data from SQL so I'm retruning it as one string with ";" as line separators so when I'm in .net I can process it. I'm then replacing ";" with a vbcrlf. If I use 1 vbcrlf the email text remains as one block. If I use 2 vbcrlf's I get a 2 lines between each line of text. I need to keep it in plain text so the mails can be easily read on all platforms.

Any help would be greatly appreciated

Lbob

This is the code I've got

Dim oMail As New System.Web.Mail.MailMessage
Dim sSubject As String, sBody As String, sEmail As String

oMail.BodyFormat = MailFormat.Text

sSubject = "Confirmation"

sDetails = Replace(sDetails, ";", vbcrlf & vbcrlf)
sBody = sDetails & vbcrlf
oMail.To = "xxxx"
oMail.From = "xxxx"
SmtpMail.SmtpServer = "xxxxxx"
oMail.Priority = MailPriority.Normal
oMail.Subject = sSubject
oMail.Body = sBody

SmtpMail.Send(oMail)

 
try either "\r\n" or Enviornment.NewLine instead of vbcrlf

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top