Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Boa tarde amigos,
Estou tendo problemas com a utilização do sistema CDONTS de envio de emails, no caso esse é um modelo de indicação de um determinado item.
Utilizo o mesmo código para envio de indicações do site e ele funciona perfeitamente, mais esse em questão não envia e nem da erro. O que poderia ser?
indicar_dvd.asp 'Página do formulári ode indicação do item
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/Cinepipoca.asp" -->
<%
Session.LCID = 1046
Response.Expires = 0
%>
<%
' *** Edit Operations: declare variables
MM_editAction = CStr(Request("URL"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables
If (CStr(Request("MM_insert")) <> "") Then
MM_editConnection = MM_Cinepipoca_STRING
MM_editTable = "comentarios"
MM_editRedirectUrl = "comentario_cad_ok.asp"
MM_fieldsStr = "id_filme|value|nome|value|email|value|data|value|avaliacao|value|mostrar_ema
il|value|titulo|value|texto|value"
MM_columnsStr = "id_filme|none,none,NULL|nome|',none,''|email|',none,''|data|',none,NULL|avaliacao|none,none,NULL|mostrar_email|none,1,0|titulo|',none,''|texto|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")
' set the form values
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(i+1) = CStr(Request.Form(MM_fields(i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
End If
%>
<%
' *** Insert Record: construct a sql insert statement and execute it
If (CStr(Request("MM_insert")) <> "") Then
' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
FormVal = MM_fields(i+1)
MM_typeArray = Split(MM_columns(i+1),",")
Delim = MM_typeArray(0)
If (Delim = "none") Then Delim = ""
AltVal = MM_typeArray(1)
If (AltVal = "none") Then AltVal = ""
EmptyVal = MM_typeArray(2)
If (EmptyVal = "none") Then EmptyVal = ""
If (FormVal = "") Then
FormVal = EmptyVal
Else
If (AltVal <> "") Then
FormVal = AltVal
ElseIf (Delim = "'") Then ' escape quotes
FormVal = "'" & Replace(FormVal,"'","''") & "'"
Else
FormVal = Delim + FormVal + Delim
End If
End If
If (i <> LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End if
MM_tableValues = MM_tableValues & MM_columns(i)
MM_dbValues = MM_dbValues & FormVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"
If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
Dim filme__MMColParam
filme__MMColParam = "1"
if (Request.QueryString("id_filme") <> "") then filme__MMColParam = Request.QueryString("id_filme")
%>
<%
set filme = Server.CreateObject("ADODB.Recordset")
filme.ActiveConnection = MM_Cinepipoca_STRING
filme.Source = "SELECT * FROM filme WHERE id_filme = " + Replace(filme__MMColParam, "'", "''") + ""
filme.CursorType = 0
filme.CursorLocation = 2
filme.LockType = 3
filme.Open()
filme_numRows = 0
%>
<html>
<head>
<meta http-equiv="Content-Language" content="pt-br" />
<meta http-equiv="Cache-Control" content="no-cache, no-store" />
<meta http-equiv="Pragma" content="no-cache, no-store" />
<meta name="robots" content="index, follow" />
<meta name="description" content="Club Video - Prazer em atender você!!! Os melhores filmes, promoções, lan-house, Recarga Online e diversos serviços especializados. Tudo ao seu alcance!" />
<meta name="keywords" content="locadora, cinema, dvd, ilhéus, ios, serviços, classificados, compras, entretenimento, animação, filmes, arte, cultura, bahia, crianças, diversão, vhs, trailers, sinopse, suspense, drama, ação, aventura, comédia, animação, romance, terror, policial, ficção, agenda, informação, clima" />
<meta name="URL" content="[http://www.clubvideo.com.br">](http://www.clubvideo.com.br)
<meta name="SUBJECT" content="Video Locadora">
<meta name="RATING" content="GENERAL">
<meta name="audience" content="all">
<meta name="LANGUAGE" content="Portuguese">
<meta name="ROBOTS" content="index,follow">
<meta name="GOOGLEBOT" content="index,follow">
<meta name="Dc.title" content="Club Video" />
<meta name="Author" content="Rodrigo F. Santos - wwBR.net" />
<link rel="SHORTCUT ICON" href="[http://www.clubvideo.com.br/favicon.ico"](http://www.clubvideo.com.br/favicon.ico) />
<link rel="apple-touch-icon" href="[http://www.clubvideo.com.br/favicon.jpg"](http://www.clubvideo.com.br/favicon.jpg) />
<title>Club Video - Prazer em Atender Você!</title>
<link rel="stylesheet" href="estilo.css" type="text/css">
<link rel="stylesheet" href="estilo_cine.css" type="text/css">
<script language=javascript>
function msg(){
window.status="Club Video - Prazer em Atender você";
return true;
}
</script>
<script language="JavaScript">
<!--
function FDK_StripChars(theFilter,theString)
{
var strOut,i,curChar
strOut = ""
for (i=0;i < theString.length; i++)
{
curChar = theString.charAt(i)
if (theFilter.indexOf(curChar) < 0) // if it's not in the filter, send it thru
strOut += curChar
}
return strOut
}
function FDK_AddToValidateArray(FormName,FormElement,Validation,SetFocus) var TheRoot=eval("document."+FormName);
if (!TheRoot.ValidateForm)
{
TheRoot.ValidateForm = true;
eval(FormName+"NameArray = new Array()")
eval(FormName+"ValidationArray = new Array()")
eval(FormName+"FocusArray = new Array()")
}
var ArrayIndex = eval(FormName+"NameArray.length");
eval(FormName+"NameArray[ArrayIndex] = FormElement");
eval(FormName+"ValidationArray[ArrayIndex] = Validation");
eval(FormName+"FocusArray[ArrayIndex] = SetFocus");
}
function FDK_ValidateNonBlank(FormElement,ErrorMsg) var msg = ErrorMsg;
var val = FormElement.value;
if (!(FDK_StripChars(" \n\t\r",val).length == 0))
{
msg="";
}
return msg;
}
function FDK_AddNonBlankValidation(FormName,FormElementName,SetFocus,ErrorMsg) {
var ValString = "FDK_ValidateNonBlank("+FormElementName+","+ErrorMsg+")"
FDK_AddToValidateArray(FormName,eval(FormElementName),ValString,SetFocus)
}
function FDK_AllInRange(x,y,theString) for (i=0; i < theString.length; i++)
{
curChar = theString.charAt(i)
if (curChar < x || curChar > y) //the char is not in range
return false
}
return true
}
function FDK_reformat(s)
{
var arg;
var sPos = 0;
var resultString = "";
for (var i = 1; i < FDK_reformat.arguments.length; i++) {
arg = FDK_reformat.arguments[i];
if (i % 2 == 1)
resultString += arg;
else
{
resultString += s.substring(sPos, sPos + arg);
sPos += arg;
}
}
return resultString;
}
function FDK_ValidateEmail(FormElement,Required,ErrorMsg)
{
var msg = "";
var val = FormElement.value;
var msgInvalid = ErrorMsg;
var theLen = FDK_StripChars(" ",val).length
if (theLen == 0) {
if (!Required) return "";
else return msgInvalid;
}
if (val.indexOf("@",0) < 0 || val.indexOf(".")<0)
{
msg = msgInvalid;
}
return msg;
}
function FDK_AddEmailValidation(FormName,FormElementName,Required,SetFocus,ErrorMsg) {
var ValString = "FDK_ValidateEmail("+FormElementName+","+Required+","+ErrorMsg+")"
FDK_AddToValidateArray(FormName,eval(FormElementName),ValString,SetFocus)
}
function FDK_Validate(FormName, stopOnFailure, AutoSubmit, ErrorHeader)
{
var theFormName = FormName;
var theElementName = "";
if (theFormName.indexOf(".")>=0)
{
theElementName = theFormName.substring(theFormName.indexOf(".")+1)
theFormName = theFormName.substring(0,theFormName.indexOf("."))
}
var ValidationCheck = eval("document."+theFormName+".ValidateForm")
if (ValidationCheck)
{
var theNameArray = eval(theFormName+"NameArray")
var theValidationArray = eval(theFormName+"ValidationArray")
var theFocusArray = eval(theFormName+"FocusArray")
var ErrorMsg = "";
var FocusSet = false;
var i
var msg
// Go through the Validate Array that may or may not exist
// and call the Validate function for all elements that have one.
if (String(theNameArray)!="undefined")
{
for (i = 0; i < theNameArray.length; i ++)
{
msg="";
if (theNameArray[i].name == theElementName || theElementName == "")
{
msg = eval(theValidationArray[i]);
}
if (msg != "")
{
ErrorMsg += "\n"+msg;
if (stopOnFailure == "1")
{
if (theFocusArray[i] && !FocusSet)
{
FocusSet=true;
theNameArray[i].focus();
}
alert(ErrorHeader+ErrorMsg);
document.MM_returnValue = false;
break;
}
else
{
if (theFocusArray[i] && !FocusSet)
{
FocusSet=true;
theNameArray[i].focus();
}
}
}
}
}
if (ErrorMsg!="" && stopOnFailure != "1")
{
alert(ErrorHeader+ErrorMsg);
}
document.MM_returnValue = (ErrorMsg=="");
if (document.MM_returnValue && AutoSubmit)
{
eval("document."+FormName+".submit()")
}
}
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="10" topmargin="0" marginwidth="10" marginheight="0">
<table width="503" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/title/indicar.gif"> <p><br>
</td>
</tr>
<tr>
<td>
<form name="form1" action="enviar_indicar_dvd.asp" method="POST">
<table align="center">
<tr valign="baseline" align="left">
<td nowrap height="28" valign="middle"><font size="2" face="Tahoma">
<font color="#0176C8">
</font><font color="#0176C8"><b>Seu nome:</b></font></font></td>
<td rowspan="7" width="160" align="center" valign="middle"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<img src="dvd/grd/<%=(filme.Fields.Item("id_filme").Value)%>.jpg" width="127" height="199">
</font></td>
</tr>
<tr valign="baseline" align="left">
<td nowrap height="28" valign="middle">
<font color="#0176C8" size="2" face="Tahoma">
<input type="text" name="remetente" value="" size="30" maxlength="50"><b>
</b></font></td>
</tr>
<tr valign="baseline">
<td nowrap align="left" height="28" valign="middle"><b>
<font size="2" face="Tahoma" color="#0176C8">
Nome do amigo:</font></b></td>
</tr>
<tr valign="baseline">
<td nowrap align="left" height="28" valign="middle">
<font color="#0176C8" size="2" face="Tahoma">
<input type="text" name="destinatario" value="" size="30" maxlength="50"><b>
</b></font></td>
</tr>
<tr valign="baseline">
<td nowrap align="left" height="28" valign="middle"><b>
<font size="2" face="Tahoma" color="#0176C8">
E-mail do amigo:</font></b></td>
</tr>
<tr valign="baseline">
<td nowrap align="left" height="28" valign="middle">
<font color="#0176C8" size="2" face="Tahoma">
<input type="text" name="email_dest" value="" size="30" maxlength="50"><b>
</b></font></td>
</tr>
<tr valign="baseline">
<td nowrap align="left" height="60" valign="middle">
<p align="center"><font face="Tahoma" size="2">
<font color="#0176C8" size="2">
<input type="submit" value="enviar indicação" name="submit" onClick="FDK_AddNonBlankValidation('form1','document.form1.titulo',true,'\'Digite um título !\'');FDK_AddNonBlankValidation('form1','document.form1.texto',true,'\'Digite seu comentário !\'');FDK_AddNonBlankValidation('form1','document.form1.nome',true,'\'Digite seu nome ou apelido !\'');FDK_AddNonBlankValidation('form1','document.form1.email',true,'\'Informe seu e-mail !\'');FDK_AddEmailValidation('form1','document.form1.email',true,true,'\'Informe seu e-mail corretamente !\'');FDK_Validate('form1',true,false,'ATENÇÃO - Club Video Locadora');return document.MM_returnValue">
</font></font></td>
</tr>
</table>
</form>
<p> </p>
</td>
</tr>
</table>
</body>
</html>
<%
filme.Close()
%>
enviar_indicar_dvd.asp 'código do arquivo para envio da indicação
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/Cinepipoca.asp" -->
<%
Dim remetente, destinatario, email_dest, filmes, id_filme
id_filme = Request.Form("id_filme")
email_dest = Request.Form("email_dest")
destinatario = Request.Form("destinatario")
remetente = Request.Form("remetente")
filmes = Request.Form("titulo")
// verifica se existe nome vazio
if id_filme <> "" then
// enviar o e-mail
Dim msg, HTML
Set Server.CreateObject("CDONTS.NewMail")
HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">"
HTML = HTML & "<html><head><title>Club Video - Prazer em Atender Você!</title><meta http-equiv=""Content-Type"" content=""text/html; charset=iso-8859-1"" /></head>"
HTML = HTML & "<body bgcolor=""#FFFFFF"" text=""#000000"">"
HTML = HTML & "<table border=""1"" width=""75%"" background=""[http://www.clubvideo.com.br/contato/bgs/kungfupanda1.jpg""](http://www.clubvideo.com.br/contato/bgs/kungfupanda1.jpg) height=""392"">"
HTML = HTML & "<tr>"
HTML = HTML & "<td width=""231"" rowspan=""3""> </td>"
HTML = HTML & "<td height=""29""> </td>"
HTML = HTML & "<td width=""139"" rowspan=""3""> </td>"
HTML = HTML & "</tr>"
HTML = HTML & "<tr>"
HTML = HTML & "<td><font face=""Verdana"" style=""font-size: 8pt""><font color=""#0000FF"">"
HTML = HTML & "<b>Olá "&destinatario&",</b></font><p><font color=""#0000FF"">"
HTML = HTML & "<b>Seu amigo(a) "&remetente&" achou o filme "&filmes&" interessante e resolveu indicá-lo para você.</b></font></p>"
HTML = HTML & "<p><font color=""#0000FF""><b>Clique no link abaixo para visualizar os dados do filme.</b></font></p>"
HTML = HTML & "<p align=""center"">"
HTML = HTML & "<b>"
HTML = HTML & "<a href=""[http://www.clubvideo.com.br/ficha_tecnica.asp?id_filme=""&id_filme&"""">"](http://www.clubvideo.com.br/ficha_tecnica.asp?id_filme=)
HTML = HTML & "<font color=""#0000FF"">"
HTML = HTML & "<img border=""0"" src=""[http://www.clubvideo.com.br/dvd/peq/""](http://www.clubvideo.com.br/dvd/peq/) width=""80"" height=""115""><br>""&filmes&""</font></a><font color=""#0000FF"">"
HTML = HTML & "</font></b>"
HTML = HTML & "<p align=""center""><b><font color=""#0000FF""><img border=""0"" src=""[http://www.clubvideo.com.br/images/logo_t.gif""](http://www.clubvideo.com.br/images/logo_t.gif) width=""100"" height=""34"" alt=""Club Video - Prazer em atender você!!!""><br>"
HTML = HTML & "ClubVideo - Prazer em Atender Você! - </font> <a href=""[http://www.clubvideo.com.br/"">"](http://www.clubvideo.com.br/)
HTML = HTML & "<font color=""#0000FF"">www.clubvideo.com.br</font></a></b></p>"
HTML = HTML & "<font face=""Tahoma, Verdana"" size=""2"">"
HTML = HTML & "<p> </td>"
HTML = HTML & "</tr>"
HTML = HTML & "<tr>"
HTML = HTML & "<td height=""25""> </td>"
HTML = HTML & "</tr>"
HTML = HTML & "</table>"
HTML = HTML & "</body></html>"
msg.From = "contato@clubvideo.com.br"
msg.To = email_dest
msg.BCC = "rodriqo@gmail.com"
msg.Subject = "Indicação de Site - Club Video"
msg.BodyFormat = 0
msg.MailFormat = 0
msg.Body = HTML
msg.Send
Response.Redirect "indicar_ok.asp"
// fecha os banco de dados
Set msg = Nothing
End if
%>
Carregando comentários...