Ir para conteúdo

POWERED BY:

Arquivado

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

Leonardo Djeri de Toledo

Problemas com envio de Formulário

Recommended Posts

Ola galera...

 

Estou com um pequeno problema. Eu tenho um formulário para envio de e-mail pelo meu site. Acontece que qundo utilizo e-mails como @terra.com.br, @uol.com.br as mensagens não chegam, e esses e-mail recebem um retorno de erro. Entrei em contato com meu provedor (LOCAWEB) e ele disse o seguinte:

 

É normal que você não consiga receber e-mails enviados com e-mails que não sejam de seu domínio porque, ao fazer isso você está colocando o e-mail @qualquer_coisa como FROM, então, tanto o SPF de lá quanto o daqui podem barrar essa mensagem porque você está enviando mensagens utilizando um rementente não autorizado a enviar por esse servidor, no caso, o servidor onde roda o script.

 

Sugiro que sempre envie mensagens utilizando como FROM o seu e-mail do domínio e se quiser, coloque o e-mail do visitante como Reply-To, para que a pessoa que responda o e-mail, responda-a para o e-mail do visitante que usou o e-mail @qualquer_coisa no seu formulário.

 

Eu utilizo os seguintes campos no formulário:

 

- NOME (nome)

- E-MAIL (email)

- TELEFONE (telefone)

- MENSAGEM(mensagem)

 

Quando envio o e-mail, ele chama a página send_email.asp

 

<%'Set the response buffer to true so we execute all code before sending to the clients browserResponse.Buffer = True'Dimension variablesDim strBody 			'Holds the body of the e-mailDim objCDOMail 			'Holds the mail server objectDim strMyEmailAddress 		'Holds your e-mail addressDim strCCEmailAddress		'Holds any carbon copy e-mail addresses if you want to send to more tahn on e-mail addressDim strReturnEmailAddress	'Holds the return e-mail address of the user'----------------- Place your e-mail address in the following sting ----------------------------------strMyEmailAddress = "meuemail@provedor.com.br"'-----------------------------------------------------------------------------------------------------'----------- Place Carbon Copy e-mail address's in the following sting, supporated by; --------------'Use this string only if you want to send the copy's of the e-mail to more than one personstrCCEmailAddress = "copiadoemail@provedor.com.br"'-----------------------------------------------------------------------------------------------------'Read in the users e-mail addressstrReturnEmailAddress = Request.Form("email")'Initialse strBody string with the body of the e-mailstrBody = "Nome: " & Request.Form("nome") & vbCrLfstrBody = strBody &  "Telefone: " & Request.Form("telefone") & vbCrLfstrBody = strBody & "E-mail: " & strReturnEmailAddress & vbCrLfstrBody = strBody & "Mensagem: "  & vbCrLf & Request.Form("mensagem") & vbCrLf'Check to see if the user has entered an e-mail address and that it is a valid address otherwise set the e-mail address to your own otherwise the e-mail will be rejectedIf Len(strReturnEmailAddress) < 5 OR NOT Instr(1, strReturnEmailAddress, " ") = 0 OR InStr(1, strReturnEmailAddress, "@", 1) < 2 OR InStrRev(strReturnEmailAddress, ".") < InStr(1, strReturnEmailAddress, "@", 1) Then		'Set the return e-mail address to your own	strReturnEmailAddress = strMyEmailAddressEnd If	'Create the e-mail server objectSet objCDOMail = Server.CreateObject("CDONTS.NewMail")	'Send the e-mail'Who the e-mail is from (this needs to have an e-mail address in it for the e-mail to be sent)objCDOMail.From = Request.Form("nome") & " <" & strReturnEmailAddress & ">"'Who the e-mail is sent toobjCDOMail.To = strMyEmailAddress'Who the carbon copies are sent toobjCDOMail.Cc = strCCEmailAddress'The subject of the e-mailobjCDOMail.Subject = "E-mail recebido via Site"'The main body of the e-amilobjCDOMail.Body = strBody'The format the e-mail is sent inobjCDOMail.MailFormat = CdoMailFormatText 'If you want it to be in MIME(HTML) format use CdoMailFormatMIME'Importance of the e-mail (0=Low, 1=Normal, 2=High)objCDOMail.Importance = 2 'Send the e-mailobjCDOMail.Send	'Close the server objectSet objCDOMail = Nothing%><html><head><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><title>Adept System Informatica</title><!-- The Surf-Net e-mail script and form is written by Bruce Corkhill ©2001	 If you want your own  e-mail script and form then goto http://www.surf-net.co.uk --> <!-- Close the HTML document head --><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css"><!--body,td,th {	font-family: Adept System;}--></style><link href="css.css" rel="stylesheet" type="text/css" /><style type="text/css"><!--body {	margin-left: 0px;	margin-right: 0px;	margin-bottom: 0px;}--></style></head><!-- Start the HTML body --><body text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#990099" alink="#FF0000" background="images/background.gif"><table width="560" border="0" cellpadding="0" cellspacing="0">  <tr>	<th width="480" background="img/bord_line.jpg" class="TituloDir" scope="col"><div align="left"><img src="img/bord_line.jpg" width="40" height="20" /></div></th>	<th width="80" class="TituloDir" scope="col"><table width="80" border="1" align="right" cellpadding="0" cellspacing="0" bordercolor="d4d0c8">	  <tr>		<th class="TituloDir" scope="col">Contato </th>	  </tr>	</table></th>  </tr>  <tr>	<th colspan="2" class="TituloDir" scope="col"> </th>  </tr></table><table width="560" border="0" cellpadding="0" cellspacing="0">	<tr>	  <td> </td>  </tr>	<tr> 	<td><h5 align="center"><span class="TituloAtual">MENSAGEM ENVIADA!</span><br>	  </h5></td>	</tr>	<tr>	  <td> </td>  </tr> </table>		<!-- Introduction body of text that is justified which looks indented by hailing a table width of 85% --><table width="560" border="0" cellpadding="0" cellspacing="0">	<tr>	<td>	<!-- Justify the text -->		  <div align="center">		<!-- Introduction Text -->		<strong class="TituloCor2">		<% = Request.Form("nome") %>		,		</strong><span class="TextoAtual">seu e-mail foi enviado com sucesso.</span></div></td>	</tr>	<tr>	  <td><div align="center"></div></td>  </tr>	<tr>	  <td><div align="center"><span class="TextoAtual">Estaremos respondendo em breve.</span></div></td>  </tr> </table><!-- Close the body --></body><!-- Close the HTML script --></html>
Eu sou iniciante em asp e nunca fiz um formulário utilizando esta opção: Reply-to. Será que vocês poderiam me ajudar???

 

Valeu!!!!!

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.