Mailed form doesn't contain all the carriage returns

G

Guy Verville

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&Billets=12&T%E9l%E9phone=444+4444+44444&PersonneFormulaire=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="(e-mail address removed)">
<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&Billets=12&T%E9l%E9phone=444+4444+44444&PersonneFormulaire=adfasdfasdf&Commentaire=asdfasdfs

FIN DU FORMULAIRE

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

Any idea?
 
P

Patrice

Is this an HTML mail ? If yes use the <br> tag instead. Carriage returns are
not part of the HTML standard...

Patrice

--
 
J

Jeff Cochran

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
 
G

Guy Verville

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
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top