Click to See Complete Forum and Search --> : ASP Form Mail sending to email, but empty, no information


leocordero
04-12-2006, 10:19 PM
Hello,
Thank you in advance for any help on this matter.
I have created a long form to be sent to my email address, I got the script from somewhere and I am not familiar at all with ASP, I need some help telling please what part of the code is missing of what is not being done correctly.
The form is suppose to send an email, I am receiving the email, but it comes complety empty, just the subject line is correct...

Thank you very much again, Leonardo :)

Here is the script for the forminfo.asp, located at www.terapiaalternativa.net/forminfo.asp (http://www.terapiaalternativa.net/forminfo.asp)

<% @LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Set Mail = Server.CreateObject("SMTPsvg.Mailer") 'create an Asp mail component.
Mail.FromName = "Informacion Terapeuta"
Mail.FromAddress= Request.Form("email")
Mail.RemoteHost = "mrelay.perfora.net" ' The mail server you have to use with Asp Mail
Mail.AddRecipient "TerapiaAlternativa.Net", "terapiaalternativainfo@gmail.com"
Mail.Subject = "Informacion Terapeuta"
Mail.BodyText = Request.Form("info")
if Mail.SendMail then
Response.Write ""
else
Response.Write "Mail send failure. Error was " & Mail.Response
end if
%>


And here is the form located at www.terapiaalternativa.net/procedimiento.html (http://www.terapiaalternativa.net/procedimiento.html)

<% @LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Set Mail = Server.CreateObject("SMTPsvg.Mailer") 'create an Asp mail component.
Mail.FromName = "Informacion Terapeuta"
Mail.FromAddress= Request.Form("email")
Mail.RemoteHost = "mrelay.perfora.net" ' The mail server you have to use with Asp Mail
Mail.AddRecipient "TerapiaAlternativa.Net", "terapiaalternativainfo@gmail.com"
Mail.Subject = "Informacion Terapeuta"
Mail.BodyText = Request.Form("Informacion Terapeuta")
if Mail.SendMail then
Response.Write "Su información ha sido enviada, gracias..."
else
Response.Write "Mail send failure. Error was " & Mail.Response
end if
%>

THERE A BIT OF HTML HERE AND THEN THE FORM>>

<form onSubmit="return ValidateForm()" name="Informacion Terapeuta" method="post" action="forminfo.asp">
<table width="80%" align="center" cellpadding="5" cellspacing="3" class="tablascomparativas">
<tr>
<td width="48%"><strong>Informaci&oacute;n de Contacto:<br>
</strong></td>
<td width="52%"><div align="right"><strong><font color="#FF0000">*</font></strong><font size="1">Informaci&oacute;n
requerida</font></div></td>
</tr>
<tr>
<td>Nombre<font color="#FF0000">*</font></td>
<td><input name="Nombre" type="text" id="Nombre"> </td>
</tr>
<tr>
<td> 1er Apellido <font color="#FF0000">*</font></td>
<td><input name="1er apellido" type="text" id="1er apellido">
</td>
</tr>
<tr>
<td>2ndo Apellido<font color="#FF0000">*</font></td>
<td><input name="2ndo apellido" type="text" id="2ndo apellido">
</td>
</tr>
<tr>
<td>Tel&eacute;fono<font color="#FF0000">*</font></td>
<td><input name="Telefono" type="text" id="Telefono"></td>
</tr>
<tr>
<td>Celular</td>
<td><input name="Celular" type="text" id="Celular"></td>
</tr>
<tr>
<td>Fax</td>
<td><input name="Fax" type="text" id="Fax"></td>
</tr>
<tr>
<td>Correo Electr&oacute;nico <font color="#FF0000">*</font></td>
<td><input name="Email" type="text" id="Email"> </td>
</tr>
<tr>
<td> P&aacute;gina Web </td>
<td><input name="Website" type="text" id="Website"></td>
</tr>
<tr>
<td>Direcci&oacute;n completa donde atiende a sus clientes:
<font color="#FF0000">*</font> </td>
<td><textarea name="Direcci&oacute;n" wrap="VIRTUAL" id="Direcci&oacute;n"></textarea>
</td>
</tr>
<tr>
<td colspan="2"><hr align="center" width="100%"></td>
</tr>
<tr>
<td><strong>Biograf&iacute;a:</strong> <font color="#FF0000">*</font></td>
<td>Puede escribirla aqu&iacute; y/o mandarla por correo electr&oacute;nico
<a href="mailto:terapiaalternativainfo@gmail.com">terapiaalternativainfo@gmail.com</a><br>
incluya una breve descripci&oacute;n de su vida y lo que
le ha llevado a dedicarse a la salud alternativa, as&iacute;
como su experiencia en el campo.</td>
</tr>
<tr>
<td colspan="2"> <textarea name="Biograf&iacute;a" cols="70" rows="10" wrap="VIRTUAL" id="Biograf&iacute;a"></textarea>
</td>
</tr>
<tr>
<td colspan="2"><hr align="center" width="100%"></td>
</tr>
<tr>
<td><strong>Educacion:<font color="#FF0000"> *</font></strong></td>
<td>Este Sitio Web busca promover a los profesionales en Terapias
Alternativas, por favor incluya todos sus estudios, certificaciones,
t&iacute;tulos universitarios, talleres, as&iacute; como
cualquier informaci&oacute;n que usted considere importante.
<br>
Si necesita m&aacute;s espacio favor envienos un email con
la informaci&oacute;n a <a href="mailto:terapiaalternativainfo@gmail.com">terapiaalternativainfo@gmail.com</a><br>
</td>
</tr>
<tr>
<td>T&iacute;tulo, certificaciones, talleres, etc.</td>
<td><input name="T&iacute;tulos" type="text" id="T&iacute;tulos"></td>
</tr>
<tr>
<td>Fechas</td>
<td><input name="Fechas T&iacute;tuloss" type="text" id="Fechas T&iacute;tuloss"></td>
</tr>
<tr>
<td>Maestros/Universidad/Instituci&oacute;n (estamos conscientes
que muchas de estas pr&aacute;cticas se pasan de maestro
a alumno, ya que esta era la forma en como se hac&iacute;a
en el pasado)</td>
<td><textarea name="Instituciones Titulos" wrap="VIRTUAL" id="Instituciones Titulos"></textarea></td>
</tr>
<tr>
<td colspan="2"><p>Escriba m&aacute;s aqu&iacute; en el formato
anterior y en ese orden (T&iacute;tulos, Fechas, Maestros
o Instituci&oacute;n)</p>
<p>
<textarea name="Mas Titulos" cols="70" rows="10" wrap="VIRTUAL" id="Mas Titulos"></textarea>
</p></td>
</tr>
<tr>
<td colspan="2"><hr align="center" width="100%"></td>
</tr>
<tr>
<td><strong>Testimonios:</strong></td>
<td>Con el fin de buscar la mayor veracidad posible, los testimonios
deben de venir de parte de sus clientes. Tambi&eacute;n
puede scanear los testimonios o cartas de agradecimiento
que tenga y enviarlas por correo electr&oacute;nico como
un documento adjunto a <a href="mailto:terapiaalternativainfo@gmail.com">terapiaalternativainfo@gmail.com</a></td>
</tr>
</table>
<div align="center"><br>
<input class="fancybut" type="submit" name="Submit" value="Envie Informaci&oacute;n">
<input class="fancybut" type="reset" name="Submit2" value="Borre todo">
</div>
</form>

THANK YOU FOR ALL YOUR ASSISTANCE ON THIS MATTER.
LEONARDO

<Eddie>
04-13-2006, 07:39 AM
A couple of points.


Firstly, I can't see a text field called 'info' and you're calling for this as the bodytext. Check the HTML.
Secondly, using spaces in names for text fields will cause all sorts of problems when handling the capture of that field so stick to one word, no spaces.


Point one is the likely cause of your problem however.

leocordero
04-13-2006, 02:04 PM
Thank you for your time,

I followed your advise and nothing happened, the email is still coming empty, I played with it in several different ways and nothing happen, the last code that I produced was this:

For the forminfo.asp: located at www.terapiaalternativa.net/forminfo.asp (http://www.terapiaalternativa.net/forminfo.asp)
<% @LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Set Mail = Server.CreateObject("SMTPsvg.Mailer") 'create an Asp mail component.
Mail.FromName = "Informacion Terapeuta"
Mail.FromAddress= Request.Form("email")
Mail.RemoteHost = "mrelay.perfora.net" ' The mail server you have to use with Asp Mail
Mail.AddRecipient "TerapiaAlternativa.Net", "terapiaalternativainfo@gmail.com"
Mail.Subject = "Informacion Terapeuta"
Mail.BodyText = Request.Form("informacionterapeuta, Nombre, 1erapellido, 2ndoapellido, Telefono, Celular, Fax, Email, Website, Direccion, Biografia, Titulos, FechasTitulos, Instituciones, TitulosMasTitulos")
if Mail.SendMail then
Response.Write ""
else
Response.Write "Mail send failure. Error was " & Mail.Response
end if
%>


And for the page where the form is we have the following code: located at www.terapiaalternativa.net/procedimiento.html (http://www.terapiaalternativa.net/procedimiento.html)
<% @LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Set Mail = Server.CreateObject("SMTPsvg.Mailer") 'create an Asp mail component.
Mail.FromName = "TerapiaAlternativa.Net"
Mail.FromAddress= Request.Form("email")
Mail.RemoteHost = "mrelay.perfora.net" ' The mail server you have to use with Asp Mail
Mail.AddRecipient "TerapiaAlternativa.Net", "terapiaalternativainfo@gmail.com"
Mail.Subject = "Informacion Terapeuta"
Mail.BodyText = Request.Form("informacionterapeuta, Nombre, 1erapellido, 2ndoapellido, Telefono, Celular, Fax, Email, Website, Direccion, Biografia, Titulos, FechasTitulos, Instituciones, TitulosMasTitulos")
if Mail.SendMail then
Response.Write "Su información ha sido enviada, gracias..."
else
Response.Write "Mail send failure. Error was " & Mail.Response
end if
%>

SOME HTML IN HERE THAT IS NOT IMPORTANT

<form onSubmit="return ValidateForm()" name="informacionterapeuta" method="post" action="forminfo.asp">
<table width="80%" align="center" cellpadding="5" cellspacing="3" class="tablascomparativas">
<tr>
<td width="48%"><strong>Informaci&oacute;n de Contacto:<br>
</strong></td>
<td width="52%"><div align="right"><strong><font color="#FF0000">*</font></strong><font size="1">Informaci&oacute;n
requerida</font></div></td>
</tr>
<tr>
<td>Nombre<font color="#FF0000">*</font></td>
<td><input name="Nombre" type="text" id="Nombre"> </td>
</tr>
<tr>
<td>1er Apellido <font color="#FF0000">*</font></td>
<td><input name="1erapellido" type="text" id="1erapellido">
</td>
</tr>
<tr>
<td>2ndo Apellido<font color="#FF0000">*</font></td>
<td><input name="2ndoapellido" type="text" id="2ndoapellido">
</td>
</tr>
<tr>
<td>Tel&eacute;fono<font color="#FF0000">*</font></td>
<td><input name="Telefono" type="text" id="Telefono"></td>
</tr>
<tr>
<td>Celular</td>
<td><input name="Celular" type="text" id="Celular"></td>
</tr>
<tr>
<td>Fax</td>
<td><input name="Fax" type="text" id="Fax"></td>
</tr>
<tr>
<td>Correo Electr&oacute;nico <font color="#FF0000">*</font></td>
<td><input name="Email" type="text" id="Email"> </td>
</tr>
<tr>
<td> P&aacute;gina Web </td>
<td><input name="Website" type="text" id="Website"></td>
</tr>
<tr>
<td>Direcci&oacute;n completa donde atiende a sus clientes:
<font color="#FF0000">*</font> </td>
<td><textarea name="Direccion" wrap="VIRTUAL" id="Direccion"></textarea>
</td>
</tr>
<tr>
<td colspan="2"><hr align="center" width="100%"></td>
</tr>
<tr>
<td><strong>Biograf&iacute;a:</strong> <font color="#FF0000">*</font></td>

</tr>
<tr>
<td colspan="2"> <textarea name="Biografia" cols="70" rows="10" wrap="VIRTUAL" id="Biografia"></textarea>
</td>
</tr>
<tr>
<td colspan="2"><hr align="center" width="100%"></td>
</tr>
<tr>
<td><strong>Educacion:<font color="#FF0000"> *</font></strong></td>
</tr>
<tr>
<td>T&iacute;tulo, certificaciones, talleres, etc.</td>
<td><input name="Titulos" type="text" id="Titulos"></td>
</tr>
<tr>
<td>Fechas</td>
<td><input name="FechasTitulos" type="text" id="FechasTitulos"></td>
</tr>
<tr>
<td><textarea name="InstitucionesTitulos" wrap="VIRTUAL" id="InstitucionesTitulos"></textarea></td>
</tr>
<tr>
<td colspan="2"> <p>
<textarea name="MasTitulos" cols="70" rows="10" wrap="VIRTUAL" id="MasTitulos"></textarea>
</p></td>
</tr>
</table>
<div align="center"><br>
<input class="fancybut" type="submit" name="Submit" value="Envie Informaci&oacute;n">
<input class="fancybut" type="reset" name="Submit2" value="Borre todo">
</div>
</form>

<Eddie>
04-13-2006, 02:09 PM
Mail.BodyText = Request.Form("informacionterapeuta, Nombre, 1erapellido, 2ndoapellido, Telefono, Celular, Fax, Email, Website, Direccion, Biografia, Titulos, FechasTitulos, Instituciones, TitulosMasTitulos")
I've never seen Request code like that before in ASP.

Try building the string and then pass that to the property of the object as below.


Dim strBodyText
strBodyText = Request.Form("informacionterapeuta")
strBodyText=strBodyText & Request.Form("Nombre")
strBodyText=strBodyText & Request.Form("1erapellido")
strBodyText=strBodyText & Request.Form("2ndoapellido")
...
strBodyText=strBodyText & Request.Form("TitulosMasTitulos")
Mail.BodyText=strBodyText


The fact you're receiving the email means it's working but if the body text is blank then it has to be the way the string is constructed. Try the above and see how it goes.

leocordero
04-13-2006, 02:39 PM
Eddie man, you rock, it worked...
the only problem we have now is that all the information comes all jammed together like this:


leonardocorderozuniga24180103897552leocordero@gmail.comwww.disfrutelavida.coma huge message here and then the rest of the message here.

CONSIDER THAT THE NUMBERS ARE 2 PHONE NUMBERS, is there a way we can make this information arrive in order, with spaces, so I can copy paste it where I need it to be at and maybe with the titles of each category, like name, last name, etc...

thank you very much for your time man. If you want to come to Costa Rica let me know and we can get together leocordero@gmail.com

Here is the code that I created for each page on top>

<% @LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Set Mail = Server.CreateObject("SMTPsvg.Mailer") 'create an Asp mail component.
Mail.FromName = "Informacion Terapeuta"
Mail.FromAddress= Request.Form("email")
Mail.RemoteHost = "mrelay.perfora.net" ' The mail server you have to use with Asp Mail
Mail.AddRecipient "TerapiaAlternativa.Net", "terapiaalternativainfo@gmail.com"
Mail.Subject = "Informacion Terapeuta"
Dim strBodyText
strBodyText = Request.Form("informacionterapeuta")
strBodyText=strBodyText & Request.Form("Nombre")
strBodyText=strBodyText & Request.Form("1erapellido")
strBodyText=strBodyText & Request.Form("2ndoapellido")
strBodyText=strBodyText & Request.Form("Telefono")
strBodyText=strBodyText & Request.Form("Celular")
strBodyText=strBodyText & Request.Form("Fax")
strBodyText=strBodyText & Request.Form("Email")
strBodyText=strBodyText & Request.Form("Website")
strBodyText=strBodyText & Request.Form("Direccion")
strBodyText=strBodyText & Request.Form("Biografia")
strBodyText=strBodyText & Request.Form("Titulos")
strBodyText=strBodyText & Request.Form("FechasTitulos")
strBodyText=strBodyText & Request.Form("Instituciones")
strBodyText=strBodyText & Request.Form("TitulosMasTitulos")
Mail.BodyText=strBodyText
if Mail.SendMail then
Response.Write ""
else
Response.Write "Mail send failure. Error was " & Mail.Response
end if
%>

<Eddie>
04-14-2006, 04:31 AM
If the email is plain text try:

Dim strBodyText
strBodyText = Request.Form("informacionterapeuta") & vbcrlf
strBodyText=strBodyText & Request.Form("Nombre") & vbcrlf
strBodyText=strBodyText & Request.Form("1erapellido") & vbcrlf
strBodyText=strBodyText & Request.Form("2ndoapellido") & vbcrlf
strBodyText=strBodyText & Request.Form("Telefono") & vbcrlf
strBodyText=strBodyText & Request.Form("Celular") & vbcrlf
strBodyText=strBodyText & Request.Form("Fax") & vbcrlf
strBodyText=strBodyText & Request.Form("Email") & vbcrlf
strBodyText=strBodyText & Request.Form("Website") & vbcrlf
strBodyText=strBodyText & Request.Form("Direccion") & vbcrlf
strBodyText=strBodyText & Request.Form("Biografia") & vbcrlf
strBodyText=strBodyText & Request.Form("Titulos") & vbcrlf
strBodyText=strBodyText & Request.Form("FechasTitulos") & vbcrlf
strBodyText=strBodyText & Request.Form("Instituciones") & vbcrlf
strBodyText=strBodyText & Request.Form("TitulosMasTitulos")
Mail.BodyText=strBodyText

If the email is HTML try:

Dim strBodyText
strBodyText = Request.Form("informacionterapeuta") & "<br>"
strBodyText=strBodyText & Request.Form("Nombre") & "<br>"
strBodyText=strBodyText & Request.Form("1erapellido") & "<br>"
strBodyText=strBodyText & Request.Form("2ndoapellido") & "<br>"
strBodyText=strBodyText & Request.Form("Telefono") & "<br>"
strBodyText=strBodyText & Request.Form("Celular") & "<br>"
strBodyText=strBodyText & Request.Form("Fax") & "<br>"
strBodyText=strBodyText & Request.Form("Email") & "<br>"
strBodyText=strBodyText & Request.Form("Website") & "<br>"
strBodyText=strBodyText & Request.Form("Direccion") & "<br>"
strBodyText=strBodyText & Request.Form("Biografia") & "<br>"
strBodyText=strBodyText & Request.Form("Titulos") & "<br>"
strBodyText=strBodyText & Request.Form("FechasTitulos") & "<br>"
strBodyText=strBodyText & Request.Form("Instituciones") & "<br>"
strBodyText=strBodyText & Request.Form("TitulosMasTitulos")
Mail.BodyText=strBodyText

leocordero
04-15-2006, 04:44 PM
Thank you very much brother, it worked...
sincerely,
Leonardo

amuluri
11-21-2007, 12:52 AM
hi all
this is AMULURI

am facing a problem in formating ASP mail which contains asp and html .
The whole body is being sent as plain text ,it is not supporting html. am using the 1&1 host , and using the same code as yours for mail.

Please help me
Thanq in advance.