News Letter
Olá pessoal, estou desenvolvendo uma ferramenta de envio de news letters, mas os emails não estão sendo enviados...
Já fiz vários tipos de depuração, mas até agora não encontrei nada que possa justificar...
Segue trecho do código. Gostaría que dessem uma lida...
<%assunto=Request.QueryString("assunto")mensagem=Request.QueryString("mensagem")interesses=Request.QueryString("interesses")Aemail_extra=Request.QueryString("email_extra")If assunto="" OR mensagem="" OR interesses="" then With(Response) .write "<script language=""JavaScript"" type=""text/JavaScript"">" & vbCrlf .write "alert ('Algum campo obrigatório não foi preenchido');" & vbCrlf .write "window.location.href=""index.asp?cat=news_letter"""&VBCRLF .write "</script>" & vbCr end with Response.Write "Algum campo obrigatório não foi preenchido <br>"Else 'localizando qual usuario tem interesse em qual assunto (interesse) na tabela de relacionamento sql_iinteresses="SELECT id_contato FROM indice_interesses WHERE id_interesse IN ("& interesses &") GROUP BY id_contato" Set rs_iinteresses=conexao.execute(sql_iinteresses) 'agrupando todos usuarios que tem interesse no assunto "X" While NOT rs_iinteresses.EOF id_contatos=id_contatos&"//"&rs_iinteresses("id_contato") rs_iinteresses.MoveNext Wend rs_iinteresses.MoveFirst 'localizando info de todos usuarios que tem interesse no assunto "X" While NOT rs_iinteresses.EOF id_contato=rs_iinteresses("id_contato") sql_contatos="SELECT id_contato, nome, email FROM contatos WHERE id_contato="& id_contato &"" Set rs_contatos=conexao.execute(sql_contatos) nome=rs_contatos("nome") email=rs_contatos("email") 'Enviando email para o usuario que tem interesse no assunto "X" Set mail_cliente = Server.CreateObject("Persits.MailSender") mail_cliente.Host = "mail.asping.com.br" mail_cliente.From = "eejhp@asping.com.br" mail_cliente.FromName = "E.E.J.H.P." mail_cliente.AddAddress email mail_cliente.Subject = assunto body_cliente= "<html>" & VbCrLf body_cliente=body_cliente& "<head>" & VbCrLf body_cliente=body_cliente& "</head>" & VbCrLf & VbCrLf body_cliente=body_cliente& "<body leftmargin=""0"" topmargin=""0"" marginwidth=""0"" marginheight=""0"">" & VbCrLf body_cliente=body_cliente& "<table width=""748"" height=""100%"" border=""0"" cellpadding=""0"" cellspacing=""0"">" & VbCrLf body_cliente=body_cliente& "<tr>" & VbCrLf body_cliente=body_cliente& "<td valign=""top"" bgcolor=""#FFFFFF""><p><font color=""#333333"" size=""3"" face=""Arial, Helvetica, sans-serif"">" & VBCrLf body_cliente=body_cliente& "<p><br><br> Olá "&nome&", <br><br><br>"& VBCrLf body_cliente=body_cliente& "</td>" & VbCrLf body_cliente=body_cliente& "</tr>" & VbCrLf body_cliente=body_cliente& "<tr>" & VbCrLf body_cliente=body_cliente& "<td valign=""top"" bgcolor=""#FFFFFF""><p><font color=""#333333"" size=""3"" face=""Arial, Helvetica, sans-serif"">" & VBCrLf body_cliente=body_cliente& "<p><blockquote>"&mensagem&"</blockquote><br><br>"& VBCrLf body_cliente=body_cliente& "</td>" & VbCrLf body_cliente=body_cliente& "</tr>" & VbCrLf body_cliente=body_cliente& "</table>" & VbCrLf body_cliente=body_cliente& "</body>" & VbCrLf body_cliente=body_cliente& "</html>" & VbCrLf mail_cliente.Body= body_cliente mail_cliente.IsHTML = True On Error Resume Next mail_cliente.Send rs_iinteresses.MoveNext Wend Next End IfEnd If Response.Write "<script Language=""JavaScript"">"&VBCrLf Response.Write "alert('News Letter enviada com sucesso!.')"&VBCrLf Response.Write "window.location.href=""index.asp?cat=news_letter" Response.Write "</SCRIPT>"&VBCrLf%>
Qualquer dúvida com relação ao código estou a disposição para esclarecimento....
Discussão (1)
Carregando comentários...