Ir para conteúdo

Arquivado

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

DackAle

Cdonts + Comandos

Recommended Posts

E ae galera =)

 

Seguinte quero enviar um e-mail para quem se cadastrou na newsletter do site do cliente, vai ter campo titulo e texto, até ai beleza, dai tenho que formatar esse email, topo, espaço pro titulo, descrição e abaixo 5 ultimosnoticias que vem do banco de dados... mas to tendo dificuldades para criar o corpo do email, juntar o ASP, com HTML...

 

exemplo

 

corpo = "<table width='416'  border='0' cellspacing='0' cellpadding='0'><tr><td><img src='imagens/logo_rinos.gif' width='157' height='100'></td></tr><tr><td><table width='416'  border='0' cellspacing='0' cellpadding='0'><tr><td width='10'> </td><td><font face='tahoma' size='2' color='#000000'>" & trim(request("variasp_corpo")) & "</font></td><td width='10'> </td></tr></table></td></tr><tr><td><img src='imagens/titulospaginasfront/eventos_tt.gif' width='416' height='28'></td></tr><tr><td>" & SQL="SELECT TOP 4 * FROM noticias ORDER BY id DESC" SET RS = Server.CreateObject("AdoDB.RecordSet") RS.Open SQL,Conexao,3,3 if not rs.eof then 	 noticia = rs.getrows() 	 end if 	  	 rs.close 	 set rs = nothing 	 if isarray(noticia) then 	 FOR I = 0 to UBOUND(noticia,2) & "<table width='416' border='0' cellspacing='0' cellpadding='0'><tr>" & if NOT noticia(3,i) = empty then & "<td width='100' height='74' align='right' valign='top'><a href='evento.asp?id=" & noticia(0,i) & "'><img src='" & caminho_noticias & noticia(3,i) "' width='90' height='68' border='0'></a></td><td width='10'> </td>" & end if & "<td valign='top'><table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td height='20' valign='top'><font face='tahoma' size='2' color='#000000'><b><a href='evento.asp?id=" & noticia(0,i) & "'>" & noticia(1,i) & "</a></b></font></td></tr><tr><td><font face='tahoma' size='2' color='#000000'>" & if len(noticia(2,i)) > 150 then texto = left(noticia(2,i),150) procura = instrrev(texto,chr(32)) response.write left(texto,cint(procura) - 1) & "..." & else response.write noticia(2,i) end if & "</font></td></tr></table></td><td width='10'> </td></tr></table><table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td align='center'><img src='backoffice/editor/imagens/tracejado.gif' width='400' height='1'></td></tr></table>"& NEXT:END IF & "</td></tr><tr><td align='center'><img src='imagens/rinoerino_c.gif' width='128' height='20'></td></tr></table>"

ai ta o html e asp, mas da erro de sintaxe de sintaxe...

 

existe forma mais facil de juntar os dois ?

 

Valeu galera =)

 

Abraçossssssss

Compartilhar este post


Link para o post
Compartilhar em outros sites

EAE DackAle

 

seguinte.... eu geralmente uso armazena todos os dados de HTML... registros do bd em variaveis mesmo...

 

mas para organizar o script eu gravo as variaveis linha por linha

 

 

tipo assim....

 

ASP [/tr][tr]

corpo = corpo + "<table width='416' border='0' cellspacing='0' cellpadding='0'><tr><td>"

corpo = corpo + "<img src='imagens/logo_rinos.gif' width='157' height='100'>"

[/tr]

 

Dai os registros eu faço o mesmo esquema...

 

ASP [/tr][tr]

corpo = corpo + "Bem Vindo " + rs("nome") + " ao nosso site"

[/tr]

 

Dessa maneira fica mais fácil de detectar erros...

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.