Email - Line Break.

A

Adam Knight

Hi all,

I am sending email via ASP.NET.
In the message i am wanting to insert a linebreak after an initial
salutation.
In asp I would simply use vbCrLf.

objEmail.Body = "Dear " & Rw("name") & "," & vbCrLf & txtMessage.Text

This doesn't work.

What do i need to do to insert the required line break.

Cheers,
Adam
 
O

Onin Tayson

Try

objEmail.Body = "Dear " & Rw("name") & "," & Chr(13) & Chr(10) &
txtMessage.Text
or
objEmail.Body = "Dear " & Rw("name") & ",<p>" & txtMessage.Text

HTH,
 
O

Onin Tayson

You can also try

objEmail.Body = "Dear " & Rw("name") & "," & Environment.NewLine &
txtMessage.Text
 
A

Adam Knight

Hi Dee,

Code:
objEmail.Body = "Dear " & Rw("name") & vbCrLf & "," & txtMessage.Text &
strUrl

Error: Name 'vbCrLf' is not declared

Cheers,
Adam
 
O

Onin Tayson

Have you tried Environment.NewLine?

Adam Knight said:
Hi Dee,

Code:
objEmail.Body = "Dear " & Rw("name") & vbCrLf & "," & txtMessage.Text &
strUrl

Error: Name 'vbCrLf' is not declared

Cheers,
Adam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top