Ir para conteúdo
Fórum Script Brasil
  • 0

Cdonts + Comandos


DackAle

Pergunta

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'>&nbsp;</td><td><font face='tahoma' size='2' color='#000000'>" & trim(request("variasp_corpo")) & "</font></td><td width='10'>&nbsp;</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'>&nbsp;</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'>&nbsp;</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

Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

  • 0

Nossa véio!!! o q q você tomou antes de fazer isso smile.gif eu quero um pouco smile.gif

Ta muito louco, dei uma organizada, da uma olhada:

<%
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'>&nbsp;</td><td><font face='tahoma' size='2' color='#000000'>" & trim(request("variasp_corpo")) & "</font></td><td width='10'>&nbsp;</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)
      corpo = corpo & "<table width='416' border='0' cellspacing='0' cellpadding='0'><tr>"
      if NOT noticia(3,i) = empty then
          corpo = corpo & "<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'>&nbsp;</td>"
      end if
      corpo = corpo & "<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))
         corpo = corpo & left(texto,cint(procura) - 1) & "..."
      else
         corpo = corpo & noticia(2,i)
      end if
      corpo = corpo & "</font></td></tr></table></td><td width='10'>&nbsp;</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
corpo = corpo & "</td></tr><tr><td align='center'><img src='imagens/rinoerino_c.gif' width='128' height='20'></td></tr></table>"
%>

Link para o comentário
Compartilhar em outros sites

  • 0

hauhuaahuahuahuhau qualquer eu tomei ? ahhuaa num tomei ainda vergonha na cara ahuhauhauhau zuera...

a minha dificuldade era juntar os selects, fors e ph junto com a parte do cdonts, mas deixa ver aqui que que deu esse codigo teu alex e te falo =)

valeuuuu

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.


  • Estatísticas dos Fóruns

    • Tópicos
      152k
    • Posts
      651,7k
×
×
  • Criar Novo...