473,320 Members | 1,841 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,320 software developers and data experts.

Email - Line Break.

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
Nov 19 '05 #1
6 4348
Try

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

HTH,

"Adam Knight" <ad**@pertrain.com.au> wrote in message
news:eD**************@TK2MSFTNGP11.phx.gbl...
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

Nov 19 '05 #2
You can also try

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

"Adam Knight" <ad**@pertrain.com.au> wrote in message
news:eD**************@TK2MSFTNGP11.phx.gbl...
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

Nov 19 '05 #3
dee
Hi Adam
I do use vbCrLf and it does work. What error are you getting?

"Adam Knight" <ad**@pertrain.com.au> wrote in message
news:eD**************@TK2MSFTNGP11.phx.gbl...
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

Nov 19 '05 #4
Hi Dee,

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

Error: Name 'vbCrLf' is not declared

Cheers,
Adam

"dee" <de*@home.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi Adam
I do use vbCrLf and it does work. What error are you getting?

"Adam Knight" <ad**@pertrain.com.au> wrote in message
news:eD**************@TK2MSFTNGP11.phx.gbl...
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


Nov 19 '05 #5
Import the Microsoft.VisualBasic namespace.

VbCrLf is a constant.

http://msdn2.microsoft.com/en-us/library/f63200h0

Juan T. Llibre
ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
==========================

"Adam Knight" <ad**@pertrain.com.au> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi Dee,

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

Error: Name 'vbCrLf' is not declared

Cheers,
Adam "dee" <de*@home.net> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi Adam
I do use vbCrLf and it does work. What error are you getting?

"Adam Knight" <ad**@pertrain.com.au> wrote in message
news:eD**************@TK2MSFTNGP11.phx.gbl...
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



Nov 19 '05 #6
Have you tried Environment.NewLine?

"Adam Knight" <ad**@pertrain.com.au> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi Dee,

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

Error: Name 'vbCrLf' is not declared

Cheers,
Adam

"dee" <de*@home.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi Adam
I do use vbCrLf and it does work. What error are you getting?

"Adam Knight" <ad**@pertrain.com.au> wrote in message
news:eD**************@TK2MSFTNGP11.phx.gbl...
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



Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Sylvie Stone | last post by:
Hi All - I have created a survey and I would like the results of the survey to be emailed the boss in *plain text*. Can someone PLEASE take a look and tell me why carriage returns are not being...
11
by: Hanjo Grüßner | last post by:
Hello, I'm not shure wether it's OT or not. I want to use an eMail as a trigger to start a program. E.g. an eMail-Group: any group-member sends an eMail to a group-e-adress an the Mail is...
2
by: Martin Körner | last post by:
Hi NG, I am using email module for creating mails with attachment (and then sending via smtplib). If the name of the attachment file is longer than about 60 characters the filename is wrapped...
8
by: Jimbo | last post by:
Hello I am currently designing an internal ordering system for IT equipment. I am designing it in ASP.NET (vb) using Visual Studio 2003 and using Microsoft SQL Server I have got the system...
9
by: Adi | last post by:
Hello eveyone, I wanna ask a very simple question here (as it was quite disturbing me for a long time.) My problem is to read a file line by line. I've tried following implementations but still...
2
by: comp.lang.php | last post by:
I came up with functions that I thought would do the trick: if (!function_exists('smtp_close')) { /** * This function will close a socket resource handle * * Original function found at...
10
by: Itaichuk | last post by:
Hi I read in several CSS tutorials that block-level elements, such as <div& <pare rendered with an implicit line break before and after. I set to test this out using the following HTML: I...
45
by: Dennis | last post by:
Hi, I have a text file that contents a list of email addresses like this: "foo@yahoo.com" "tom@hotmail.com" "jerry@gmail.com" "tommy@apple.com" I like to
4
n8kindt
by: n8kindt | last post by:
ok, i've done quite a bit of research on my problem here. random "! " will appear in my email that i'm sending thru cdo. i've learned that this problem occurs when there are long lines of html (or...
7
by: jeddiki | last post by:
Hi, I am using a function called htmlwrap() which states that it does NOT add a "<br>" to the 70 character line so that it forces a line wrap. ( the script safely wraps long words without...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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)...
0
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...

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.