Ver Mensaje Individual
  #10 (permalink)  
Antiguo 13/10/2008, 08:29
compublack
 
Fecha de Ingreso: septiembre-2008
Mensajes: 1
Antigüedad: 15 años, 7 meses
Puntos: 0
Respuesta: Re: enviar un e-mail desde mi pagina

Me encanto tu codigo, me podes orientar donde lo tengo que copiar para que funcione bien
Soy un novato(para orientar tu explicacion no?
GRacias
Negro


Cita:
Iniciado por jocaorsa Ver Mensaje
Yo lo hice asi a ver si les sirve de ayuda, un saludo
************************************************** ***************
<%
Option Explicit
On Error Resume Next

Dim gtxtTitle, gtxtEmailSubject, gtxtErrPrompt, gtxtEmailNote, gtxtSiteAdminEmailPrompt
Dim gtxtYourNamePrompt, gtxtYourEmailPrompt, gtxtYourIPPrompt,gtxtYourDepartamentoPrompt, gtxtYourAsuntoPrompt, gtxtEventDescriptionPrompt, gtxtSendEmailButton
Dim gtxtInvalidEmailAddress, gtxtDescriptionRequired, gtxtErrWritingLog
'=====================================
' Begin Resource text - BEGIN TRANSLATE
'=====================================
gtxtInvalidEmailAddress = "El dirección de email inválido, por favor introduzca una dirección de email válido."
gtxtDescriptionRequired = "Por favor introduzca la descripcion de los eventos enter a description of the eventos que rodean el error."
gtxtTitle = "E-mail"
gtxtEmailSubject = ""
gtxtErrPrompt = ""
gtxtSiteAdminEmailPrompt = "E-mail del administrador"
gtxtYourNamePrompt = "Nombre Usuario"
gtxtYourEmailPrompt = "E-mail Usuario"
gtxtYourIPPrompt = "IP Usuario"
gtxtYourDepartamentoPrompt = "Departamento al que pertenece"
gtxtYourAsuntoPrompt = "Asunto"
gtxtEventDescriptionPrompt = "Incidencias"
gtxtSendEmailButton = "Enviar E-mail"
gtxtproducedBy = "Producido por"
gtxtClose = "Cerrar"
'=====================================
' End Resource text - END TRANSLATE
'=====================================

Dim timestamp, bLogSuccess
timestamp = CLng(Request.Form("timestamp"))
bLogSuccess = CBool(Request.Form("logsuccess"))
%>
<html>
<head>
<title><%=gtxtTitle%></title>
<script type="text/javascript" language="javascript">
<!--
function sendEmail()
{
var form = document.forms["erroremail"];
var d = new Date();
var subject = "<%=gtxtEmailSubject%> (" + d.toDateString() + " " + d.toLocaleTimeString() + ")";
var CC = form.useremail.value;
var to = form.adminemail.value;
var desc = form.errordesc.value;
if ("" == desc)
{
alert("<%=gtxtDescriptionRequired%>");
return;
}
// validate to email address
var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;// not valid
var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
if (!reg1.test(to) && reg2.test(to))
{
var mailto = "mailto:" + to + "?subject=" + subject;
// if CC email address is valid, add it
if (!reg1.test(CC) && reg2.test(CC))
mailto += "&CC=" + CC;
form.action = mailto;
form.submit();
window.close();
}
else
{
alert("<%=gtxtInvalidEmailAddress%>");
}
}
//-->
</script>
<style type="text/css">
body
{
font: 10pt Arial;
}
table.errordetails
{
border:1px solid black;
background-color: gainsboro;
width:100%;
font: 10pt Arial;
padding: 0px;
margin: 0px;
}
tr.errortr
{
}
th.errorth
{
text-align:center;
}
td.errorprompt
{
text-align: right;
padding-right: 2px;
}
td.errordata
{
background-color: White;
color: Red;
text-align: left;
width:70%;
padding-left: 2px;
}
</style>
</head>
<body>
<p><%=gtxtErrPrompt%></p>
<p><%=gtxtEmailNote%></p>
<font color="#FF0000">
<%
if not bLogSuccess then
Response.Write "<p style=""color:red;"">" & gtxtErrWritingLog & "</p>" & vbcrlf
end if
%>*<u><b>NOTA:</b></u> El uso del E-mail debe ser para informar sobre
errores en la Web, consulta o para hacer algún comentario para la mejora del
GIS.</font><form name="erroremail" id="erroremail" method="post" enctype="text/plain">
<table class="errordetails" width="50%" style="background-color: #CBE3F0">
<tr>
<td align="right" width="27%"><span style="color:red;">*</span>&nbsp;<%=gtxtSiteAdminEmailPrompt%>:</td>
<td align="left" width="896"><select name="adminemail" size="1">
<option value="[email protected]">Admin1</option>
<option VALUE="[email protected]">Admin2</option>
<option VALUE="[email protected]">Admin3</option>
</select> </td>
</tr>
<tr>
<td align="right" width="27%"><span style="color:red;">*</span>&nbsp;<%=gtxtYourNamePrompt%>:</td>
<td align="left" width="896"><input type="text" name="username"></td>
</tr>
<tr>
<td align="right" width="27%"><span style="color:red;">*</span>&nbsp;<%=gtxtYourDepartamentoPrompt%>:</td>
<td align="left" width="896"><input type="text" name="departamento"></td>
</tr>
<tr>
<td align="right" width="27%"><%=gtxtYourEmailPrompt%>:</td>
<td align="left" width="896"><input type="text" name="useremail"></td>
</tr>
<tr>
<td align="right" width="27%"><%=gtxtYourIPPrompt%>:</td>
<td align="left" width="896"><input type="text" readonly="readonly" name="IP" value="<%Response.Write + Request.ServerVariables("REMOTE_ADDR")%>"></td>
</tr>
<tr>
<td align="right" width="27%"><span style="color:red;">*</span>&nbsp;<%=gtxtYourAsuntoPrompt%>:</td>
<td align="left" width="896"><input type="text" name="asunto"></td>
</tr>
<tr>
<td align="right" valign="top" width="27%"><span style="color:red;">*</span>&nbsp;<%=gtxtEventDescriptionPrompt%>:</td>
<td align="left" width="896"><textarea name="errordesc" rows="8" cols="40"></textarea></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" value="<%=gtxtSendEmailButton%>" onclick="javascript:sendEmail();">
<input type="button" value="Cerrar" onclick="javascript:window.close();">
</td>
</tr>
</table>
<input type="hidden" name="timestamp" value="<%=CStr(timestamp)%>">
</form>
<p align="center">
<img border="0" src="file://gisapp/pruebas/images/ingr_logo_web.gif" width="120" height="29">
</p>
</body>
</html>