Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

jsouza000

Erro ao enviar email para o contato

Recommended Posts

Espero que consigam resolver este problemas pois já tentei de varias formas e não consigo

Formulário de contato criado no phpmyadmin e inserido pelo DW está dando o seguinte erro:

Error:

Error sending e-mail.

Developer Details:

E-mail couldn't be sent. Error returned: Failed to connect to mail.meudominio.com.br :26 [sMTP: Failed to connect socket: (code: -1, response: )]. (EMAIL_FAILED)

tNG Execution Trace - VIEW

•tNG_insert.executeTransaction

◦STARTER.Trigger_Default_Starter

◦tNG_insert.doTransaction

■BEFORE.Trigger_Default_FormValidation

■tNG_insert.prepareSQL

■tNG_insert.executeTransaction - execute sql

■tNG_insert.postExecuteSql

■AFTER.Trigger_SendEmail* --> esta linha está em vermelho assinalando o erro.

■ERROR.Trigger_Default_Insert_RollBack

•tNG_insert.getRecordset

•tNG_insert.getFakeRsArr

•tNG_insert.getLocalRecordset

•tNG_insert.getFakeRecordset

•tNG_insert.getFakeRecordset

 

 

JÁ Tentei mudar a porta de saída já mudei a conta de correio no webmail mas não adianta. preciso resolver logo este problema. Obrigado!

 

Segue abaixo o codigo da pagina com o formulario:

 

<?php require_once('Connections/Usuarios.php'); ?>

<?php

//MX Widgets3 include

require_once('includes/wdg/WDG.php');

 

// Load the common classes

require_once('includes/common/KT_common.php');

 

// Load the tNG classes

require_once('includes/tng/tNG.inc.php');

 

// Make a transaction dispatcher instance

$tNGs = new tNG_dispatcher("");

 

// Make unified connection variable

$conn_Usuarios = new KT_connection($Usuarios, $database_Usuarios);

 

// Start trigger

$formValidation = new tNG_FormValidation();

$formValidation->addField("Nome", true, "text", "", "", "", "Insira um valor válido.");

$formValidation->addField("Email", true, "text", "email", "", "", "Insira um valor válido.");

$formValidation->addField("Assunto", true, "text", "", "", "", "Insira um valor válido.");

$formValidation->addField("Mensagem", true, "text", "", "", "1000", "Insira um valor válido.");

$tNGs->prepareValidation($formValidation);

// End trigger

 

//start Trigger_SendEmail trigger

//remove this line if you want to edit the code by hand

function Trigger_SendEmail(&$tNG) {

$emailObj = new tNG_Email($tNG);

$emailObj->setFrom("{KT_defaultSender}");

$emailObj->setTo("{Email}");

$emailObj->setCC("");

$emailObj->setBCC("");

$emailObj->setSubject("Re: contato site");

//WriteContent method

$emailObj->setContent("olá estou testando meu servidor obrigado.\n");

$emailObj->setEncoding("ISO-8859-1");

$emailObj->setFormat("Text");

$emailObj->setImportance("Normal");

return $emailObj->Execute();

}

//end Trigger_SendEmail trigger

 

// Make an insert transaction instance

$ins_contato = new tNG_insert($conn_Usuarios);

$tNGs->addTransaction($ins_contato);

// Register triggers

$ins_contato->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");

$ins_contato->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);

$ins_contato->registerTrigger("END", "Trigger_Default_Redirect", 99, "gerentest.php");

$ins_contato->registerTrigger("AFTER", "Trigger_SendEmail", 98);

// Add columns

$ins_contato->setTable("contato");

$ins_contato->addColumn("Nome", "STRING_TYPE", "POST", "Nome");

$ins_contato->addColumn("Email", "STRING_TYPE", "POST", "Email");

$ins_contato->addColumn("Assunto", "STRING_TYPE", "POST", "Assunto");

$ins_contato->addColumn("Mensagem", "STRING_TYPE", "POST", "Mensagem");

$ins_contato->addColumn("status", "STRING_TYPE", "POST", "status", "off");

$ins_contato->setPrimaryKey("id", "NUMERIC_TYPE");

 

// Execute all the registered transactions

$tNGs->executeTransactions();

 

// Get the transaction recordset

$rscontato = $tNGs->getRecordset("contato");

$row_rscontato = mysql_fetch_assoc($rscontato);

$totalRows_rscontato = mysql_num_rows($rscontato);

?>

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

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wdg="http://ns.adobe.com/addt">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Untitled Document</title>

<link href="includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />

<script src="includes/common/js/base.js" type="text/javascript"></script>

<script src="includes/common/js/utility.js" type="text/javascript"></script>

<script src="includes/skins/style.js" type="text/javascript"></script>

<?php echo $tNGs->displayValidationRules();?>

<script type="text/javascript" src="includes/common/js/sigslot_core.js"></script>

<script type="text/javascript" src="includes/wdg/classes/MXWidgets.js"></script>

<script type="text/javascript" src="includes/wdg/classes/MXWidgets.js.php"></script>

<script type="text/javascript" src="includes/wdg/classes/RestrictedTextArea.js"></script>

</head>

 

<body>

<p> 

<?php

echo $tNGs->getErrorMsg();

?>

<form method="post" id="form1" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>">

<table cellpadding="2" cellspacing="0" class="KT_tngtable">

<tr>

<td class="KT_th"><label for="Nome">Nome:</label></td>

<td><input type="text" name="Nome" id="Nome" value="<?php echo KT_escapeAttribute($row_rscontato['Nome']); ?>" size="32" />

<?php echo $tNGs->displayFieldHint("Nome");?> <?php echo $tNGs->displayFieldError("contato", "Nome"); ?> </td>

</tr>

<tr>

<td class="KT_th"><label for="Email">Email:</label></td>

<td><input type="text" name="Email" id="Email" value="<?php echo KT_escapeAttribute($row_rscontato['Email']); ?>" size="32" />

<?php echo $tNGs->displayFieldHint("Email");?> <?php echo $tNGs->displayFieldError("contato", "Email"); ?> </td>

</tr>

<tr>

<td class="KT_th"><label for="Assunto">Assunto:</label></td>

<td><input type="text" name="Assunto" id="Assunto" value="<?php echo KT_escapeAttribute($row_rscontato['Assunto']); ?>" size="32" />

<?php echo $tNGs->displayFieldHint("Assunto");?> <?php echo $tNGs->displayFieldError("contato", "Assunto"); ?> </td>

</tr>

<tr>

<td class="KT_th"><label for="Mensagem">Mensagem:</label></td>

<td><textarea name="Mensagem" cols="50" rows="5" id="Mensagem" wdg:subtype="RestrictedTextArea" wdg:type="widget" wdg:maxchars="1000" wdg:showcount="true" wdg:showmessage="true"><?php echo KT_escapeAttribute($row_rscontato['Mensagem']); ?></textarea>

<?php echo $tNGs->displayFieldHint("Mensagem");?> <?php echo $tNGs->displayFieldError("contato", "Mensagem"); ?> </td>

</tr>

<tr class="KT_buttons">

<td colspan="2"><input type="submit" name="KT_Insert1" id="KT_Insert1" value="Insert record" />

</td>

</tr>

</table>

<input type="hidden" name="status" id="status" value="<?php echo KT_escapeAttribute($row_rscontato['status']); ?>" />

</form>

<p> </p>

</p>

</body>

</html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.