uno tiene 10 direcciones (criterio = 1) y el otro tiene 200 direcciones (criterio = 2)
Construí una pagina que a medida que lee el recordset de direcciones de correo, manda el mail.
Algo asi:
Cita:
HTML="<html><body>esto es una prueba</body></html>"
Sql="SELECT email FROM mitabla (nolock) where criterio = 1"
Set Rs = con.Execute (Sql)
if not Rs.EOF then
while not RS.EOF
Call SendMail(Rs("email"),HTML)
Rs.Movenext
wend
end if
Set Rs = nothing
Function SendMail(vEmail,vHTML)
Set objMail = Server.CreateObject("CDO.Message")
Set objConf = Server.CreateObject("CDO.Configuration")
Set objFields = objConf.Fields
With objFields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "127.0.0.1"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With
With objMail
Set .Configuration = objConf
.From = "[email protected]"
.To = vEmail
.Subject = "mi subject"
.HTMLBody = vHTML
End With
Err.Clear
on error resume next
objMail.Send
if not (len(Err.Description) = 0) then
response.Write Err.Description + "<br>"
else
response.Write "ok!" + "<br>"
end if
Set objFields = Nothing
Set objConf = Nothing
Set objMail = Nothing
end function
Sql="SELECT email FROM mitabla (nolock) where criterio = 1"
Set Rs = con.Execute (Sql)
if not Rs.EOF then
while not RS.EOF
Call SendMail(Rs("email"),HTML)
Rs.Movenext
wend
end if
Set Rs = nothing
Function SendMail(vEmail,vHTML)
Set objMail = Server.CreateObject("CDO.Message")
Set objConf = Server.CreateObject("CDO.Configuration")
Set objFields = objConf.Fields
With objFields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "127.0.0.1"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With
With objMail
Set .Configuration = objConf
.From = "[email protected]"
.To = vEmail
.Subject = "mi subject"
.HTMLBody = vHTML
End With
Err.Clear
on error resume next
objMail.Send
if not (len(Err.Description) = 0) then
response.Write Err.Description + "<br>"
else
response.Write "ok!" + "<br>"
end if
Set objFields = Nothing
Set objConf = Nothing
Set objMail = Nothing
end function
El problema está en que mandé los 10 del primer listado y todos llegaron.
Y cuando mandé los 200 de una sola patada, a pesar de que todos fueron enviados (o al menos eso me decia el codigo) ninguno de los usuarios lo recibió.
Cual seria la mejor forma de asegurarme de que todos recibioran el correo?
Pausando el envío cada 10 o 20 cristianos?
Se puede hacer eso?
o mando uno y pauso, mando uno y pauso?
Que sugieren?