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

Mailed form doesn't contain all the carriage returns

I'm perplexed, I have several forms that seem to be ok, but what is sent by
email doesn't contain all the Carriage returns sent.

The form contains many fields and is sent as follow:
Destinataire=gv%40guyverville.com&Sujet=Calendrier +des+concerts&Date=2004+12+22&R%E9gion=15--Bas-Saint-Laurent%2FGasp%E9sie&Heure=20%3A30&Lieu=Montr%E9al &Chorale=Baroquo-negro&Chef=blah+blah&Accompagnateurs=Blah+blah&Nom +du+concert=blah+blah&R%E9pertoire=blah+blah&Bille ts=12&T%E9l%E9phone=444+4444+44444&PersonneFormula ire=adfasdfasdf&Commentaire=asdfasdfs

The form calls COURRIEL.ASP in that fashion:

<FORM METHOD="POST" ACTION="courriel.asp?Rubrique=2">
<INPUT TYPE="hidden" name="Destinataire" value="gv@guyverville.com">
<INPUT TYPE="hidden" name="Sujet" value="Calendrier des concerts">
You can see all the form here:
http://www.chorale.qc.ca/default.asp?Rubrique=2

COURRIEL.ASP is built as follows:

************************************************** *********************

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@LANGUAGE="VBSCRIPT"%>
<%
Public srtMsgInfo
Dim strHost
Public Rubrique
Public Erreur
Public Bris
Bris= chr(13) & chr(10)

Test=0
...............

//A FUNCTION TO BUILT THE BODY PART OF THE EMAIL
Function BatirEntree2 (NomChamp,Presentation,Obligatoire)
Valeur=Request.Form(cstr(NomChamp))
if Obligatoire=1 and Valeur="" then 'TEST FOR MANDATORY FIELDS
Test=1
Erreur= Erreur & "/" & NomChamp & "<br />"
end if
BatirEntree2= strMsgInfo & "//" & Presentation & " = " & Valeur & " " &
Bris
end function

strHost ="10.4.1.3"
Set Mailer = Server.CreateObject("Persits.MailSender")
Mailer.Host = strHost
Mailer.FromName = Request.Form("Nom")
Mailer.AddAddress Request("Destinataire")
Mailer.From = Request.Form("Courriel")
Mailer.Subject = Request.Form("Sujet")

if(Request.QueryString("rubrique") <> "") then
Rubrique = Replace(Request.QueryString("rubrique"), "'", "''")
else
Rubrique=100
end if

Select Case Rubrique
Case 1

...................
Case 2
strMsgInfo= Mailer.Subject & Bris
strMsgInfo= BatirEntree2("Date","Date AAAA MM JJ",1)
strMsgInfo= BatirEntree2("Heure","Heure HH:MM",1)
strMsgInfo= BatirEntree2("Lieu","Lieu du concert et adresse complète",1)
strMsgInfo= BatirEntree2("Chorale","Nom de la chorale",1)
strMsgInfo= BatirEntree2("Chef","Nom du chef",0)
strMsgInfo= BatirEntree2("Accompagnateurs","Noms des accompagnateurs,
instruments ou solistes",0)
strMsgInfo= BatirEntree2("Nom du Concert","Nom du Concert",1)
strMsgInfo= BatirEntree2("Répertoire","Répertoire",1)
strMsgInfo= BatirEntree2("Billets","Prix du billet",1)
strMsgInfo= BatirEntree2("PersonneFormulaire","Nom de la personne ayant
rempli le formulaire",0)
strMsgInfo= strMsgInfo & "*************************Partie ci-dessous
réservée à l'ACQ " & Bris
strMsgInfo= BatirEntree2("Téléphone","Téléphone",0)
strMsgInfo= BatirEntree2("Commentaire","Commentaire",0)
strMsgInfo= BatirEntree2("Région","Région",0)
strMsgInfo= strMsgInfo & "Données du
formulaire**************************** " & Bris
strMsgInfo= strMsgInfo & cstr(Request.Form) & " " & Bris

----------------------

end select

if Test=1 then
response.write "<h4>Certains champs sont obligatoires. Veuillez retourner
au formulaire et corriger les champs suivants </h4>"
response.write "<p class=""marge"">Erreur sur : " & Erreur & "</p>"
else
strMsgHeader = "CE FORMULAIRE A ÉTÉ ENVOYÉ VIA LE SITE WEB" & vbCrLf &
vbCrLf
strMsgFooter = vbCrLf & vbCrLf & "FIN DU FORMULAIRE"
Mailer.Body = strMsgHeader & strMsgInfo & strMsgFooter
if Mailer.Send then
' Message sent Ok, redirect to a confirmation page
Response.Redirect ("acq01.asp?Rubrique=4")
else
' Message send failure
Response.Write ("An error has occurred.<BR>")
' Send error message
Response.Write ("The error was " & Mailer.Response)
end if
end if
%>

************************************************** **********************************************

The result is this. All fields should have been in its own row:

CE FORMULAIRE A ÉTÉ ENVOYÉ VIA LE SITE WEB

Calendrier des concerts

//Date AAAA MM JJ = 2004 12 22

//Heure HH:MM = 20:30

//Lieu du concert et adresse complète = Montréal //Nom de la chorale =
Baroquo-negro //Nom du chef = blah blah //Noms des accompagnateurs,
instruments ou solistes = Blah blah //Nom du Concert = blah blah
//Répertoire = blah blah //Prix du billet = 12 //Nom de la personne ayant
rempli le formulaire = adfasdfasdf

*************************Partie ci-dessous réservée à l'ACQ

//Téléphone = 444 4444 44444

//Commentaire = asdfasdfs

//Région = 15--Bas-Saint-Laurent/Gaspésie Données du
formulaire****************************

Destinataire=gv%40guyverville.com&Sujet=Calendrier +des+concerts&Date=2004+12+22&R%E9gion=15--Bas-Saint-Laurent%2FGasp%E9sie&Heure=20%3A30&Lieu=Montr%E9al &Chorale=Baroquo-negro&Chef=blah+blah&Accompagnateurs=Blah+blah&Nom +du+concert=blah+blah&R%E9pertoire=blah+blah&Bille ts=12&T%E9l%E9phone=444+4444+44444&PersonneFormula ire=adfasdfasdf&Commentaire=asdfasdfs

FIN DU FORMULAIRE

************************************************** **********************************************

Any idea?
Jul 19 '05 #1
3 1765
Is this an HTML mail ? If yes use the <br> tag instead. Carriage returns are
not part of the HTML standard...

Patrice

--

"Guy Verville" <ta*****@spamcop.net> a écrit dans le message de
news:u4**************@TK2MSFTNGP11.phx.gbl...
I'm perplexed, I have several forms that seem to be ok, but what is sent by email doesn't contain all the Carriage returns sent.

The form contains many fields and is sent as follow:
Destinataire=gv%40guyverville.com&Sujet=Calendrier +des+concerts&Date=2004+12
+22&R%E9gion=15--Bas-Saint-Laurent%2FGasp%E9sie&Heure=20%3A30&Lieu=Montr%E9a
l&Chorale=Baroquo-negro&Chef=blah+blah&Accompagnateurs=Blah+blah&Nom +du+conc
ert=blah+blah&R%E9pertoire=blah+blah&Billets=12&T% E9l%E9phone=444+4444+44444
&PersonneFormulaire=adfasdfasdf&Commentaire=asdfas dfs
The form calls COURRIEL.ASP in that fashion:

<FORM METHOD="POST" ACTION="courriel.asp?Rubrique=2">
<INPUT TYPE="hidden" name="Destinataire" value="gv@guyverville.com">
<INPUT TYPE="hidden" name="Sujet" value="Calendrier des concerts">
You can see all the form here:
http://www.chorale.qc.ca/default.asp?Rubrique=2

COURRIEL.ASP is built as follows:

************************************************** *********************

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@LANGUAGE="VBSCRIPT"%>
<%
Public srtMsgInfo
Dim strHost
Public Rubrique
Public Erreur
Public Bris
Bris= chr(13) & chr(10)

Test=0
..............

//A FUNCTION TO BUILT THE BODY PART OF THE EMAIL
Function BatirEntree2 (NomChamp,Presentation,Obligatoire)
Valeur=Request.Form(cstr(NomChamp))
if Obligatoire=1 and Valeur="" then 'TEST FOR MANDATORY FIELDS
Test=1
Erreur= Erreur & "/" & NomChamp & "<br />"
end if
BatirEntree2= strMsgInfo & "//" & Presentation & " = " & Valeur & " " &
Bris
end function

strHost ="10.4.1.3"
Set Mailer = Server.CreateObject("Persits.MailSender")
Mailer.Host = strHost
Mailer.FromName = Request.Form("Nom")
Mailer.AddAddress Request("Destinataire")
Mailer.From = Request.Form("Courriel")
Mailer.Subject = Request.Form("Sujet")

if(Request.QueryString("rubrique") <> "") then
Rubrique = Replace(Request.QueryString("rubrique"), "'", "''")
else
Rubrique=100
end if

Select Case Rubrique
Case 1

..................
Case 2
strMsgInfo= Mailer.Subject & Bris
strMsgInfo= BatirEntree2("Date","Date AAAA MM JJ",1)
strMsgInfo= BatirEntree2("Heure","Heure HH:MM",1)
strMsgInfo= BatirEntree2("Lieu","Lieu du concert et adresse complète",1)
strMsgInfo= BatirEntree2("Chorale","Nom de la chorale",1)
strMsgInfo= BatirEntree2("Chef","Nom du chef",0)
strMsgInfo= BatirEntree2("Accompagnateurs","Noms des accompagnateurs,
instruments ou solistes",0)
strMsgInfo= BatirEntree2("Nom du Concert","Nom du Concert",1)
strMsgInfo= BatirEntree2("Répertoire","Répertoire",1)
strMsgInfo= BatirEntree2("Billets","Prix du billet",1)
strMsgInfo= BatirEntree2("PersonneFormulaire","Nom de la personne ayant
rempli le formulaire",0)
strMsgInfo= strMsgInfo & "*************************Partie ci-dessous
réservée à l'ACQ " & Bris
strMsgInfo= BatirEntree2("Téléphone","Téléphone",0)
strMsgInfo= BatirEntree2("Commentaire","Commentaire",0)
strMsgInfo= BatirEntree2("Région","Région",0)
strMsgInfo= strMsgInfo & "Données du
formulaire**************************** " & Bris
strMsgInfo= strMsgInfo & cstr(Request.Form) & " " & Bris

----------------------

end select

if Test=1 then
response.write "<h4>Certains champs sont obligatoires. Veuillez retourner
au formulaire et corriger les champs suivants </h4>"
response.write "<p class=""marge"">Erreur sur : " & Erreur & "</p>"
else
strMsgHeader = "CE FORMULAIRE A ÉTÉ ENVOYÉ VIA LE SITE WEB" & vbCrLf &
vbCrLf
strMsgFooter = vbCrLf & vbCrLf & "FIN DU FORMULAIRE"
Mailer.Body = strMsgHeader & strMsgInfo & strMsgFooter
if Mailer.Send then
' Message sent Ok, redirect to a confirmation page
Response.Redirect ("acq01.asp?Rubrique=4")
else
' Message send failure
Response.Write ("An error has occurred.<BR>")
' Send error message
Response.Write ("The error was " & Mailer.Response)
end if
end if
%>

************************************************** **************************
********************
The result is this. All fields should have been in its own row:

CE FORMULAIRE A ÉTÉ ENVOYÉ VIA LE SITE WEB

Calendrier des concerts

//Date AAAA MM JJ = 2004 12 22

//Heure HH:MM = 20:30

//Lieu du concert et adresse complète = Montréal //Nom de la chorale =
Baroquo-negro //Nom du chef = blah blah //Noms des accompagnateurs,
instruments ou solistes = Blah blah //Nom du Concert = blah blah
//Répertoire = blah blah //Prix du billet = 12 //Nom de la personne ayant
rempli le formulaire = adfasdfasdf

*************************Partie ci-dessous réservée à l'ACQ

//Téléphone = 444 4444 44444

//Commentaire = asdfasdfs

//Région = 15--Bas-Saint-Laurent/Gaspésie Données du
formulaire****************************

Destinataire=gv%40guyverville.com&Sujet=Calendrier +des+concerts&Date=2004+12
+22&R%E9gion=15--Bas-Saint-Laurent%2FGasp%E9sie&Heure=20%3A30&Lieu=Montr%E9a
l&Chorale=Baroquo-negro&Chef=blah+blah&Accompagnateurs=Blah+blah&Nom +du+conc
ert=blah+blah&R%E9pertoire=blah+blah&Billets=12&T% E9l%E9phone=444+4444+44444
&PersonneFormulaire=adfasdfasdf&Commentaire=asdfas dfs
FIN DU FORMULAIRE

************************************************** **************************
********************
Any idea?

Jul 19 '05 #2
On Tue, 21 Sep 2004 13:46:29 -0400, "Guy Verville"
<ta*****@spamcop.net> wrote:
I'm perplexed, I have several forms that seem to be ok, but what is sent by
email doesn't contain all the Carriage returns sent.


You didn't send any. :)

Change the lines you have like:

strMsgInfo= BatirEntree2("Chef","Nom du chef",0)

to add the CR, as in:

strMsgInfo= BatirEntree2("Chef","Nom du chef",0) & VbCrLf

Or use the ASC code or a <br> if you're sending HTML.

Jeff
Jul 19 '05 #3
Jeff, the VBCrLf code is used in the BatirEntree2 function. This was not =
the problem. VbVrLF seemed not to work properly, until I double it... =
"VbCrLf & VbCrLf"

Guy

"Jeff Cochran" <je*********@zina.com> a écrit dans le message de news:
41****************@msnews.microsoft.com...
On Tue, 21 Sep 2004 13:46:29 -0400, "Guy Verville"
<ta*****@spamcop.net> wrote:
I'm perplexed, I have several forms that seem to be ok, but what is sent
by
email doesn't contain all the Carriage returns sent.


You didn't send any. :)

Change the lines you have like:

strMsgInfo= BatirEntree2("Chef","Nom du chef",0)

to add the CR, as in:

strMsgInfo= BatirEntree2("Chef","Nom du chef",0) & VbCrLf

Or use the ASC code or a <br> if you're sending HTML.

Jeff

Jul 19 '05 #4

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

Similar topics

3
by: steve.burgess | last post by:
I have a form on my website (http://www.nprie.info/content.php?pn=12&frm3~5). When the user submits the form various validation checks are completed by another PHP script. If any of these fail,...
2
by: Harlin Seritt | last post by:
Hi, I am using CherryPy to make a very small Blog web app. Of course I use a textarea input on a page to get some information. Most of the time when text is entered into it, there will be...
5
by: Susan Geller | last post by:
Character returns stored in a table do not display in a textbox or on a datagrid on my .net form. The text displays without the returns making the text difficult to read. When I "view source" on...
2
by: Matt Mercer | last post by:
Hi all, I am having a frustration problem, and I have read about 25 newsgroup postings that do not have a satisfying answer :) The problem appears to be common where carriage returns are lost...
8
by: TheDude5B | last post by:
Hi, I have some data which is stored in my MySQL database as TEXT. when the data is entered in, it has some carriage returns in it, and this can be seen when querying the data using MySQL Query...
8
by: david.lindsay.green | last post by:
Hello all, I am quite new a web scripting and making web pages in general and I have stumbled across a problem I have as yet been unable to solve. I am trying to take the contents of a textarea box...
7
by: mattrapoport | last post by:
I have a page with a div on it. The div displays a user comment. When the user logs into this page, their current comment is pulled from a db and displayed in the div. The user can edit the...
4
by: Tony Girgenti | last post by:
Hello. When i look at a web form in design view, i have the option to view the HTML. Some of the HTML code is in one long string and hard to read. Is it OK to put in carriage returns and...
2
by: draven76 | last post by:
Hi, I've got an html form with a big textarea. It's max 90 lines, 58 chars per line (there is a script that, when you write the form, cuts off the 59th char and warns you not to go beyond 58 chars...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.