Ir para conteúdo

POWERED BY:

Arquivado

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

eduardofelden

Envio Simultâneo de E-mail

Recommended Posts

Olá!

 

Estou tentado enviar uma newsletter para diversos colunistas de um site, onde que eu seleciono-os num select utilizando a tecla ctrl.

Utilizo o ASPMail com o seguinte código:

 

ASP

[*]

 

[*] 'Requisicao de variáveis

 

[*] Assunto Request.Form("Assunto")

 

[*] Emails Request.Form("Emails")

 

[*]

 

[*] 'Cria e envia o e-mail para o colunista e uma cópia para o usuário que enviou o e-mail...

 

[*] 'Cria o objeto

 

[*] set mailer server.createobject("SMTPsvg.Mailer")

 

[*] Mailer.ContentType "text/html"

 

[*] Mailer.FromName "Webmaster - Eduardo K. Felden - DCE"

 

[*] Mailer.FromAddress "eduardofelden@dceunijui.com"

 

[*] 'Host para envio de emails

 

[*] Mailer.RemoteHost "smtp.dceunijui.com"

 

[*] Mailer.AddRecipient Emails', sNameTo

 

[*] Mailer.Subject "Newsletter Colunistas: "&TituloAssunto & " | E-mail"

 

[*]

 

[*] 'Monta a texto para o envio

 

[*] strHTML "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN"" ""http://www.w3.org/TR/html4/loose.dtd"">"&vblf

 

[*] strHTML = strHTML &"<html>"&vblf

 

[*] strHTML = strHTML &"<head>"&vblf

 

[*] strHTML = strHTML &"<meta http-equiv=""Content-Type"" content=""text/html; charset=iso-8859-1"">"&vblf

 

[*] strHTML = strHTML &"<title>Comentário Colunistas</title>"&vblf

 

[*] strHTML = strHTML &"<style>"&vblf

 

[*] strHTML = strHTML &" body {margin:0px; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;}"&vblf

 

[*] strHTML = strHTML &" a {text-decoration: none;}"&vblf

 

[*] strHTML = strHTML &" a:hover {text-decoration: underline}"&vblf

 

[*] strHTML = strHTML &" .tm5 {margin: 7px 7px 7px 7px;}"&vblf

 

[*] strHTML = strHTML &" .style2 {margin: 7px 7px 7px 7px; font-weight: bold; }"&vblf

 

[*] strHTML = strHTML &" .style4 {"&vblf

 

[*] strHTML = strHTML &" color: #c20000;"&vblf

 

[*] strHTML = strHTML &" font-weight: bold;"&vblf

 

[*] strHTML = strHTML &"}"&vblf

 

[*] strHTML = strHTML &".style5 {color: #9F9F9F}"&vblf

 

[*] strHTML = strHTML &".style6 {margin: 7px 7px 7px 7px; color: #878787; }"&vblf

 

[*] strHTML = strHTML &".style7 {margin: 7px 7px 7px 7px; color: #787878; }"&vblf

 

[*] strHTML = strHTML &"</style>"&vblf

 

[*] strHTML = strHTML &"</head>"&vblf

 

[*] strHTML = strHTML &""&vblf

 

[*] strHTML = strHTML &"<body>"&vblf

 

[*] strHTML = strHTML &"<table width=""500"" border=""0"" cellspacing=""0"" cellpadding=""0"">"&vblf

 

[*] strHTML = strHTML &" <tr>"&vblf

 

[*] strHTML = strHTML &" <td><img src=""http://www.dceunijui.com/i/mails/colunas/topo_corpoMailColunista.gif"" width=""500"" height=""50""></td>"&vblf

 

[*] strHTML = strHTML &" </tr>"&vblf

 

[*] strHTML = strHTML &" <tr>"&vblf

 

[*] strHTML = strHTML &" <td height=""450"" valign=""top"" background=""/i/mails/colunas/bg_corpoMailColunista.gif""><div class=""style2"">Caro(a) Colunista!<br></div><div class=""style7"">"&strConteudo&"</div>"&vblf

 

[*] strHTML = strHTML &" </tr>"&vblf

 

[*] strHTML = strHTML &" <tr>"&vblf

 

[*] strHTML = strHTML &" <td><img src=""http://www.dceunijui.com/i/mails/colunas/bt_corpoMailColunista.gif"" width=""500"" height=""5""></td>"&vblf

 

[*] strHTML = strHTML &" </tr>"&vblf

 

[*] strHTML = strHTML &"</table>"&vblf

 

[*] strHTML = strHTML &"</body>"&vblf

 

[*] strHTML = strHTML &"</html>"&vblf

 

[*] Mailer.BodyText = strHTML

 

[*] ' Se for enviado redirecionar para obrigado.asp

 

[*] if Mailer.SendMail then

 

[*] 'Response.Redirect "obrigado.asp"

 

[*] else

 

[*] ' Se não for enviado mostra o erro que ocoreu

 

[*] Response.Write ("Ocorreu um erro.<BR>")

 

[*] Response.Write ("O Erro é " & Mailer.Response)

 

[*] end if

 

[*]

 

[*]

mas da um erro quando tento enviar. Alguem sabe o que pode estar havendo pra nao enviar os mails. Agradeço pela ajuda.

 

Eduardo Konageski Felden

Compartilhar este post


Link para o post
Compartilhar em outros sites

Posta aí o erro pra que a gente possa te ajudar.

 

Wall  http://forum.imasters.com.br/public/style_emoticons/default/devil.gif

<{POST_SNAPBACK}>

Este é o erro que está ocorrendo:

O Erro é 503 Bad sequence of commands. You must specify the recipients of a message before you can send it

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.