Blastman Postado Dezembro 9, 2010 Denunciar Share Postado Dezembro 9, 2010 Oi pessoal, estou a precisar de uma help para voltar a colocar uma página que uso para enviar newsletters a funcionar.O problema surgiu devido à mudança de servidor. Antes o envio de emails era feito com CDonts e agora é por objEmail. Envio em baixo o code antigo<%endereco = "http://www.zoominstudio.eu/zoomin/"SET UPLOAD = Server.CreateObject("Persits.upload")lang = Trim(Request("lang"))Upload.OverwriteFiles = FalseUpload.Save Server.Mappath("../upload")For Each File in Upload.Filesarquivo = File.FileNameNextSet FSO = Server.CreateObject("Scripting.FileSystemObject")Set TXT = FSO.OpenTextFile(Server.Mappath("../emails/newsletter_" & lang & ".asp"))texto = txt.readALLTXT.closeSet TXT = NothingSet FSO = Nothingvariasp_assunto = Trim(Upload.Form("variasp_assunto"))variasp_titulo = Trim(Upload.Form("variasp_titulo"))variasp_mensagem = Trim(Upload.Form("variasp_mensagem"))variasp_mensagem = Replace(variasp_mensagem,chr(13),"<br>")texto = replace(texto,"##texto##",variasp_mensagem)if arquivo <> "" thentexto = replace(texto,"##imagem##","<img src='" & endereco & "upload/" & arquivo & "' border='0'")elseif arquivo = "" thentexto = replace(texto,"##imagem##","")end ifSQL="SELECT TOP 3 id, titulo_" & lang & ", descricao_" & lang & ", imagem FROM news ORDER BY id DESC"SET RS = Server.CreateObject("AdoDB.RecordSet")RS.Open SQL,Conexao,3,3if not rs.eof thennews = rs.getrows()end ifrs.closeset rs = nothingif isarray(news) ThenFOR I=0 TO UBOUND(news,2)noticias = noticias & "<table width='480' border='0' cellspacing='0' cellpadding='0'>"noticias = noticias & "<tr>"noticias = noticias & "<td>"noticias = noticias & "<table width='480' border='0' cellspacing='0' cellpadding='0'>"noticias = noticias & "<tr>"noticias = noticias & "<td width='110' height='100'><a href='" & endereco & "news_detalhe.asp?id=" & news(0,I) & "' target='_blank'><img src='" & endereco & "upload/" & news(3,I) & "' width='100' height='100' border='0'></a></td>"noticias = noticias & "<td valign='top'><table width='100%' border='0' cellspacing='0' cellpadding='0'>"noticias = noticias & "<tr>"noticias = noticias & "<td height='22' valign='top' class='textonormal'><b><a href='" & endereco & "news_detalhe.asp?id=" & news(0,I) & "' class='textonormal' target='_blank'><font size='1' color='606060' face='tahoma'>" & news(1,I) & "</font></a></b></td>"noticias = noticias & "</tr>"noticias = noticias & "<tr>"noticias = noticias & "<td height='78' valign='top' class='textonormal'><font size='2' color='666666' face='tahoma'>" & left(troca(news(2,I)),250) & "...</font></td>"noticias = noticias & "</tr>"noticias = noticias & "</table></td>"noticias = noticias & "</tr>"noticias = noticias & "</table>"noticias = noticias & "</td>"noticias = noticias & "</tr>"noticias = noticias & "</table>"noticias = noticias & "<br><br>"nextend iftexto = replace(texto,"##noticias##",noticias)IF variasp_assunto = "Individual" THENFor Each Item in Upload.Formemails = Trim(Item)quebrar = split(emails,",")transforma = textoSET UPLOAD = NothingFOR I=LBOUND(quebrar) TO UBOUND(quebrar)quebrar2 = split(quebrar(i),"-")Set CDONTS2 = Server.CreateObject("CDONTS.NewMail")CDONTS2.From = "ZOOMIN STUDIO" & "<zoominstudio@gmail.com>"if ubound(quebrar2) > 0 thentransforma = replace(transforma,"##nome##",quebrar2(0))email = quebrar2(1)CDONTS2.To = quebrar2(0) & "<" & email & ">"end iftransforma2 = replace(transforma,"##email##",email)CDONTS2.BodyFormat = 0CDONTS2.MailFormat = 0CDONTS2.Subject = variasp_tituloCDONTS2.Body = transforma2CDONTS2.SendSET CDONTS2 = NothingNEXTNEXTELSEIF variasp_assunto = "Todos" THENSET RS_email = Conexao.EXECUTE("SELECT * FROM newsletter WHERE lang = '" & lang & "' ORDER BY id ASC")While Not RS_email.EOFtransforma = textonome = RS_email("nome")email = RS_email("email")transforma = replace(transforma,"##nome##",nome)transforma2 = replace(transforma,"##email##",email)Set CDONTS2 = Server.CreateObject("CDONTS.NewMail")CDONTS2.From = "ZOOMIN STUDIO" & "<carlosars9@gmail.com>"CDONTS2.To = emailCDONTS2.Importance = 1CDONTS2.BodyFormat = 0CDONTS2.MailFormat = 0CDONTS2.Subject = variasp_tituloCDONTS2.Body = transforma2CDONTS2.SendSET CDONTS2 = NothingRS_email.movenextWendELSEIF variasp_assunto <> "Individual" OR variasp_assunto <> "Todos" THENSET RS_email = Conexao.EXECUTE("SELECT * FROM newsletter WHERE assunto = '" & variasp_assunto & "' and lang = '" & lang & "' ORDER BY id ASC")While Not RS_email.EOFtransforma = textonome = RS_email("nome")email = RS_email("email")transforma = replace(transforma,"##nome##",nome)transforma2 = replace(transforma,"##email##",email)Set CDONTS2 = Server.CreateObject("CDONTS.NewMail")CDONTS2.From = "ZOOMIN STUDIO" & "<carlosars9@gmail.com>"CDONTS2.To = emailCDONTS2.Importance = 1CDONTS2.BodyFormat = 0CDONTS2.MailFormat = 0CDONTS2.Subject = variasp_tituloCDONTS2.Body = transforma2CDONTS2.SendSET CDONTS2 = NothingRS_email.movenextWendEND IF%><html><head><title><%=titulo_admin%></title><link href="../css/pura_admin.css" rel="stylesheet" type="text/css"></head><body><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="top"><table width="98%" border="0" cellspacing="0" cellpadding="0"><!--#include file="../includes/admin_topo.asp"--> <tr> <td> </td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="170" align="left" valign="top"><!--#include file="../includes/admin_categorias.asp"--></td> <td width="10"> </td> <td align="center" valign="top"><table width="96%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="21"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="8"><img src="../imagens_admin/ponta_esq.jpg" width="8" height="21"></td> <td background="../imagens_admin/fundo_menu.jpg" class="texto_preto_bold_01">Área Administrativa - Newsletter </td> <td width="8"><img src="../imagens_admin/ponta_dir.jpg" width="8" height="21"></td> </tr> </table></td> </tr> <tr> <td class="tabela_cinza_esq_dir"> </td> </tr> <tr> <td align="center" class="tabela_cinza_esq_dir"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="10"> </td> <td align="center" class="texto_preto_bold_01">Newsletter enviada com sucecesso!<br><br> <a href="admin_newsletter_port.asp"><font color=000000>Voltar</font></a></td> <td width="10"> </td> </tr> </table></td> </tr> <tr> <td class="tabela_cinza_esq_dir_baixo"> </td> </tr> </table></td> <td width="10" align="center" valign="top"> </td> </tr> </table></td> </tr> <tr> <td> </td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="8" height="21"><img src="../imagens_admin/ponta_esq.jpg" width="8" height="21"></td> <td align="center" valign="middle" background="../imagens_admin/fundo_menu.jpg"><%=rodape_admin%></td> <td width="8"><img src="../imagens_admin/ponta_dir.jpg" width="8" height="21"></td> </tr> </table></td> </tr> </table></td> </tr></table></body></html><%conexao.closeset conexao = nothing%>Code cedido pelo host:<%Set objEmail = Server.CreateObject("Persits.MailSender") objEmail.Username = "you@domain.com"objEmail.Password = "password"objEmail.Host = "mymail.brinkster.com"objEmail.From = "you@domain.com"objEmail.AddAddress "user@domain.com"objEmail.Subject = "Test message sent using the ASPEMail component"objEmail.Body = "This is a test message."objEmail.Send Set objEmail = Nothing%> Citar Link para o comentário Compartilhar em outros sites More sharing options...
0 bareta Postado Dezembro 10, 2010 Denunciar Share Postado Dezembro 10, 2010 é o so mudar onde usa CDONTS para PERSISTS... não existe segredo de como fazer issoSet CDONTS2 = Server.CreateObject("CDONTS.NewMail") CDONTS2.From = "ZOOMIN STUDIO" & "<carlosars9@gmail.com>" CDONTS2.To = email CDONTS2.Importance = 1 CDONTS2.BodyFormat = 0 CDONTS2.MailFormat = 0 CDONTS2.Subject = variasp_titulo CDONTS2.Body = transforma2 CDONTS2.Send SET CDONTS2 = Nothing Para Set CDONTS2 = Server.CreateObject("Persits.MailSender") CDONTS2.Username = "you@domain.com" CDONTS2.Password = "password" CDONTS2.Host = "mymail.brinkster.com" CDONTS2.From = "ZOOMIN STUDIO" & "<carlosars9@gmail.com>" CDONTS2.AddAddress = email CDONTS2.Subject = variasp_titulo CDONTS2.Body = transforma2 CDONTS2.Send SET CDONTS2 = Nothing Citar Link para o comentário Compartilhar em outros sites More sharing options...
0 Blastman Postado Dezembro 14, 2010 Autor Denunciar Share Postado Dezembro 14, 2010 OI, obg pela resposta, mas me parece que persiste algum problema, porque gera um erroMicrosoft VBScript runtime error '800a01b6'Object doesn't support this property or method: 'CDONTS2.TO'/painel/env_news.asp, line 101 Obrigado, Blast Citar Link para o comentário Compartilhar em outros sites More sharing options...
0 bareta Postado Dezembro 15, 2010 Denunciar Share Postado Dezembro 15, 2010 no seu código você tem 2 pontos onde o envio acontece, verifique se alterou ambos... e se alterou todos os campos... pois o .to é do cdonts... e no aspmail se usa .AddAddress Citar Link para o comentário Compartilhar em outros sites More sharing options...
0 Blastman Postado Dezembro 16, 2010 Autor Denunciar Share Postado Dezembro 16, 2010 O erro mantém-se Bareta!Para além desse bug gostava ainda de colocar um ligthbox na galeriahttp://www.zoominstudio.eu/portfolio.asp?id=0é possivel?Sem mais, Blastman Citar Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
Blastman
Oi pessoal, estou a precisar de uma help para voltar a colocar uma página que uso para enviar newsletters a funcionar.
O problema surgiu devido à mudança de servidor. Antes o envio de emails era feito com CDonts e agora é por objEmail.
Envio em baixo o code antigo
<%
endereco = "http://www.zoominstudio.eu/zoomin/"
SET UPLOAD = Server.CreateObject("Persits.upload")
lang = Trim(Request("lang"))
Upload.OverwriteFiles = False
Upload.Save Server.Mappath("../upload")
For Each File in Upload.Files
arquivo = File.FileName
Next
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set TXT = FSO.OpenTextFile(Server.Mappath("../emails/newsletter_" & lang & ".asp"))
texto = txt.readALL
TXT.close
Set TXT = Nothing
Set FSO = Nothing
variasp_assunto = Trim(Upload.Form("variasp_assunto"))
variasp_titulo = Trim(Upload.Form("variasp_titulo"))
variasp_mensagem = Trim(Upload.Form("variasp_mensagem"))
variasp_mensagem = Replace(variasp_mensagem,chr(13),"<br>")
texto = replace(texto,"##texto##",variasp_mensagem)
if arquivo <> "" then
texto = replace(texto,"##imagem##","<img src='" & endereco & "upload/" & arquivo & "' border='0'")
elseif arquivo = "" then
texto = replace(texto,"##imagem##","")
end if
SQL="SELECT TOP 3 id, titulo_" & lang & ", descricao_" & lang & ", imagem FROM news ORDER BY id DESC"
SET RS = Server.CreateObject("AdoDB.RecordSet")
RS.Open SQL,Conexao,3,3
if not rs.eof then
news = rs.getrows()
end if
rs.close
set rs = nothing
if isarray(news) Then
FOR I=0 TO UBOUND(news,2)
noticias = noticias & "<table width='480' border='0' cellspacing='0' cellpadding='0'>"
noticias = noticias & "<tr>"
noticias = noticias & "<td>"
noticias = noticias & "<table width='480' border='0' cellspacing='0' cellpadding='0'>"
noticias = noticias & "<tr>"
noticias = noticias & "<td width='110' height='100'><a href='" & endereco & "news_detalhe.asp?id=" & news(0,I) & "' target='_blank'><img src='" & endereco & "upload/" & news(3,I) & "' width='100' height='100' border='0'></a></td>"
noticias = noticias & "<td valign='top'><table width='100%' border='0' cellspacing='0' cellpadding='0'>"
noticias = noticias & "<tr>"
noticias = noticias & "<td height='22' valign='top' class='textonormal'><b><a href='" & endereco & "news_detalhe.asp?id=" & news(0,I) & "' class='textonormal' target='_blank'><font size='1' color='606060' face='tahoma'>" & news(1,I) & "</font></a></b></td>"
noticias = noticias & "</tr>"
noticias = noticias & "<tr>"
noticias = noticias & "<td height='78' valign='top' class='textonormal'><font size='2' color='666666' face='tahoma'>" & left(troca(news(2,I)),250) & "...</font></td>"
noticias = noticias & "</tr>"
noticias = noticias & "</table></td>"
noticias = noticias & "</tr>"
noticias = noticias & "</table>"
noticias = noticias & "</td>"
noticias = noticias & "</tr>"
noticias = noticias & "</table>"
noticias = noticias & "<br><br>"
next
end if
texto = replace(texto,"##noticias##",noticias)
IF variasp_assunto = "Individual" THEN
For Each Item in Upload.Form
emails = Trim(Item)
quebrar = split(emails,",")
transforma = texto
SET UPLOAD = Nothing
FOR I=LBOUND(quebrar) TO UBOUND(quebrar)
quebrar2 = split(quebrar(i),"-")
Set CDONTS2 = Server.CreateObject("CDONTS.NewMail")
CDONTS2.From = "ZOOMIN STUDIO" & "<zoominstudio@gmail.com>"
if ubound(quebrar2) > 0 then
transforma = replace(transforma,"##nome##",quebrar2(0))
email = quebrar2(1)
CDONTS2.To = quebrar2(0) & "<" & email & ">"
end if
transforma2 = replace(transforma,"##email##",email)
CDONTS2.BodyFormat = 0
CDONTS2.MailFormat = 0
CDONTS2.Subject = variasp_titulo
CDONTS2.Body = transforma2
CDONTS2.Send
SET CDONTS2 = Nothing
NEXT
NEXT
ELSEIF variasp_assunto = "Todos" THEN
SET RS_email = Conexao.EXECUTE("SELECT * FROM newsletter WHERE lang = '" & lang & "' ORDER BY id ASC")
While Not RS_email.EOF
transforma = texto
nome = RS_email("nome")
email = RS_email("email")
transforma = replace(transforma,"##nome##",nome)
transforma2 = replace(transforma,"##email##",email)
Set CDONTS2 = Server.CreateObject("CDONTS.NewMail")
CDONTS2.From = "ZOOMIN STUDIO" & "<carlosars9@gmail.com>"
CDONTS2.To = email
CDONTS2.Importance = 1
CDONTS2.BodyFormat = 0
CDONTS2.MailFormat = 0
CDONTS2.Subject = variasp_titulo
CDONTS2.Body = transforma2
CDONTS2.Send
SET CDONTS2 = Nothing
RS_email.movenext
Wend
ELSEIF variasp_assunto <> "Individual" OR variasp_assunto <> "Todos" THEN
SET RS_email = Conexao.EXECUTE("SELECT * FROM newsletter WHERE assunto = '" & variasp_assunto & "' and lang = '" & lang & "' ORDER BY id ASC")
While Not RS_email.EOF
transforma = texto
nome = RS_email("nome")
email = RS_email("email")
transforma = replace(transforma,"##nome##",nome)
transforma2 = replace(transforma,"##email##",email)
Set CDONTS2 = Server.CreateObject("CDONTS.NewMail")
CDONTS2.From = "ZOOMIN STUDIO" & "<carlosars9@gmail.com>"
CDONTS2.To = email
CDONTS2.Importance = 1
CDONTS2.BodyFormat = 0
CDONTS2.MailFormat = 0
CDONTS2.Subject = variasp_titulo
CDONTS2.Body = transforma2
CDONTS2.Send
SET CDONTS2 = Nothing
RS_email.movenext
Wend
END IF
%>
<html>
<head>
<title><%=titulo_admin%></title>
<link href="../css/pura_admin.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top"><table width="98%" border="0" cellspacing="0" cellpadding="0">
<!--#include file="../includes/admin_topo.asp"-->
<tr>
<td> </td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="170" align="left" valign="top"><!--#include file="../includes/admin_categorias.asp"--></td>
<td width="10"> </td>
<td align="center" valign="top"><table width="96%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="21"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="8"><img src="../imagens_admin/ponta_esq.jpg" width="8" height="21"></td>
<td background="../imagens_admin/fundo_menu.jpg" class="texto_preto_bold_01">Área Administrativa - Newsletter </td>
<td width="8"><img src="../imagens_admin/ponta_dir.jpg" width="8" height="21"></td>
</tr>
</table></td>
</tr>
<tr>
<td class="tabela_cinza_esq_dir"> </td>
</tr>
<tr>
<td align="center" class="tabela_cinza_esq_dir"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10"> </td>
<td align="center" class="texto_preto_bold_01">Newsletter enviada com sucecesso!<br><br>
<a href="admin_newsletter_port.asp"><font color=000000>Voltar</font></a></td>
<td width="10"> </td>
</tr>
</table></td>
</tr>
<tr>
<td class="tabela_cinza_esq_dir_baixo"> </td>
</tr>
</table></td>
<td width="10" align="center" valign="top"> </td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="8" height="21"><img src="../imagens_admin/ponta_esq.jpg" width="8" height="21"></td>
<td align="center" valign="middle" background="../imagens_admin/fundo_menu.jpg"><%=rodape_admin%></td>
<td width="8"><img src="../imagens_admin/ponta_dir.jpg" width="8" height="21"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<%
conexao.close
set conexao = nothing
%>
Code cedido pelo host:
<%
Set objEmail = Server.CreateObject("Persits.MailSender")
objEmail.Username = "you@domain.com"
objEmail.Password = "password"
objEmail.Host = "mymail.brinkster.com"
objEmail.From = "you@domain.com"
objEmail.AddAddress "user@domain.com"
objEmail.Subject = "Test message sent using the ASPEMail component"
objEmail.Body = "This is a test message."
objEmail.Send
Set objEmail = Nothing
%>
Link para o comentário
Compartilhar em outros sites
4 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.