Ir para conteúdo

POWERED BY:

Arquivado

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

Loma

o que tem de errado aqui?

Recommended Posts

Oi genti, seguinte assim não ta enviando o email:

 

sql = "select  * from newsmsg"set rs = cn.Execute(sql)titulo1 = rs("titulo1")foto1 = rs("foto1")texto1 = rs("texto1")titulo2 = rs("titulo2")foto2 = rs("foto2")texto2 = rs("texto2")'response.Write texto2'response.End()Corpo = "<table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td><img src='www.votolimpo.com.br/admin/img_newsletter/TOPO_NEWSLETTER.gif' width='500' height='120'></td></tr></table><table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td width='20' height='15'></td><td height='15'><img src='www.votolimpo.com.br/admin/img_newsletter/titulos.gif'></td><td width='20' height='15'>"Corpo = Corpo + "</td></tr></table><table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td width='20'></td><td><font face='verdana' size='4' color='#D97500'>"&titulo1&"</font></td><td width='20'> </td></tr></table><table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td width='20'></td><td width='150'><img src='www.votolimpo.com.br/admin/"&foto1&"' width='140'></td><td valign='top'><a href='http://www.pensarorio.com.br'><font face='verdana' size='2' color='#000000'>"&texto1&"</font></a></td><td width='20'> </td></tr>"Corpo = Corpo + "</table><table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td> </td></tr></table><table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td height='1' bgcolor='#999999'></td></tr></table><table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td> </td></tr></table><table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td width='20' height='15'></td><td height='15'><img src='www.votolimpo.com.br/admin/img_newsletter/titulos.gif'>"Corpo = Corpo + "</td><td width='20' height='15'></td></tr></table><table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td width='20'></td><td><font face='verdana' size='4' color='#D97500'>"&titulo2&"</font></td><td width='20'> </td></tr></table><table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td width='20'></td>"Corpo = Corpo + "<td width='150'><img src='www.votolimpo.com.br/admin/"&foto2&"' width='140'></td><td valign='top'><a href='www.pensarorio.com.br'><font face='verdana' size='2' color='#000000'>"&replace(texto2,chr(13),"<br>")&"</font></a></td><td width='20'> </td></tr></table><table width='500' border='0' cellspacing='0' cellpadding='0'><br><tr><td><img src='www.votolimpo.com.br/admin/img_newsletter/rodape_NEWSLETTER.gif' width='500' height='60'></td></tr</table>"'Instancia o objetoSet objMail = Server.CreateObject("CDO.Message")'Seta as propriendadesobjMail.From = "contato@votolimpo.com.br"objMail.To = "lomasurf@gmail.com" 'email da pessoa que você vai enviarobjMail.Subject= "Contato Votolimpo" 'assuntoobjMail.HTMLBody = Corpo 'corpo do email'Enviando emailreturn = objMail.Send'Testa concistenciaif return <> 0 thenresponse.write "Erro: " & returnelseresponse.write "Mensagem enviada com sucesso."end if'Limpa o objetoSet objMail = Nothing

ai é só eu tirar isso que envia

 

sql = "select  * from newsmsg"set rs = cn.Execute(sql)titulo1 = rs("titulo1")foto1 = rs("foto1")texto1 = rs("texto1")titulo2 = rs("titulo2")foto2 = rs("foto2")texto2 = rs("texto2")'response.Write texto2'response.End()Corpo = "<table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td><img src='www.votolimpo.com.br/admin/img_newsletter/TOPO_NEWSLETTER.gif' width='500' height='120'></td></tr></table><table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td width='20' height='15'></td><td height='15'><img src='www.votolimpo.com.br/admin/img_newsletter/titulos.gif'></td><td width='20' height='15'>"Corpo = Corpo + "</td></tr></table><table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td width='20'></td><td><font face='verdana' size='4' color='#D97500'>"&titulo1&"</font></td><td width='20'> </td></tr></table><table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td width='20'></td><td width='150'><img src='www.votolimpo.com.br/admin/"&foto1&"' width='140'></td><td valign='top'><a href='http://www.pensarorio.com.br'><font face='verdana' size='2' color='#000000'>"&texto1&"</font></a></td><td width='20'> </td></tr>"Corpo = Corpo + "</table><table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td> </td></tr></table><table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td height='1' bgcolor='#999999'></td></tr></table><table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td> </td></tr></table><table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td width='20' height='15'></td><td height='15'><img src='www.votolimpo.com.br/admin/img_newsletter/titulos.gif'>"Corpo = Corpo + "</td><td width='20' height='15'></td></tr></table><table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td width='20'></td><td><font face='verdana' size='4' color='#D97500'>"&titulo2&"</font></td><td width='20'> </td></tr></table><table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td width='20'></td>"Corpo = Corpo + "<td width='150'><img src='www.votolimpo.com.br/admin/"&foto2&"' width='140'></td><td valign='top'><a href='www.pensarorio.com.br'><font face='verdana' size='2' color='#000000'>"&replace(texto2,chr(13),"<br>")&"</font></a></td><td width='20'> </td></tr></table><table width='500' border='0' cellspacing='0' cellpadding='0'><br><tr><td><img src='www.votolimpo.com.br/admin/img_newsletter/rodape_NEWSLETTER.gif' width='500' height='60'></td></tr</table>"

o q q tem de errado?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Po mas é string ele concatena tb.eu mudei aqui vou testar e posto logo em seguida!brigadu bjks

Compartilhar este post


Link para o post
Compartilhar em outros sites

Acho que já sei seu problema Loma.

 

É que tá cheio de quebra de linha na string corpo, daí o asp dá erro.

 

Tipo tenta montar ela assim:

 

Corpo = "<table width='500' border='0' cellspacing='0' " 'veja que fechei a string aquiCorpo = Corpo & "cellpadding='0'><tr><td><img " 'fechei denovoCorpo = Corpo & "src='www.votolimpo.com.br/admin/img_newsletter/TOPO_NEWSLETTER.gif'"

Resumindo, se você tentar fazer uma string, começando ela numa linha e tentando fechar em outra linha. O ASP entende erroneamente a quebra.

Ou seja, infelizmente você tem que ficar concatenando (como eu fiz acima) ou DEIXAR A STRING TODA em UMA LINHA SÓ.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Achei o problema.

ta na ultima linha do Corpo

 

acho que o problema ta em executar isso aqui

&replace(texto2,chr(13),"<br>")&
ta errado?

 

bjs

Compartilhar este post


Link para o post
Compartilhar em outros sites

Pois é... Viajei no meu post anterior. heheTesta tirando isso aí então. Se você tirar e funcionar, daí dá um Response.write nisso aí separado só pra ver o erro qeu o asp retorna nele.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Putzzzzz

nem sei explicar.

Mas tirei essa linha aqui e funcou na boa...

 

<img src='www.votolimpo.com.br/admin/img_newsletter/rodape_NEWSLETTER.gif' width='500' height='60'>

alguém saberia o motivo disso?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Não adiantou não, sinistro isso hein...só colocar essa imagem e o treco não funfa

Compartilhar este post


Link para o post
Compartilhar em outros sites

Po valeu mesmo lucas vou testar.Po eu dei uma pesuisada e achei essa sintaxe ai.ta funcionando numa boa, derrepente tem coisas para adcionar só!bjks

Compartilhar este post


Link para o post
Compartilhar em outros sites

Po desse jeito que to fazendo o email ta chegando lucas.mas vou ver esse modo ai q você falou

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.