Ho una newsletter che spedisce una mail a + indirizzi di posta memorizzati in un database....l'ho chiamata send.asp....poi ho una pagina email.asp che ha il seguente contenuto:
<%
destinatario=request("Destinatario")
tipo=request("Tipo")
email=request("Email")
mittente=request("Mittente")
oggetto=request("Oggetto")
if tipo="html" then
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.BodyFormat = 0
objMail.MailFormat = 0
objMail.From=mittente
objMail.To=destinatario
objMail.Subject=oggetto
objMail.Body=email
objMail.Send
Set objMail = nothing
else
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.BodyFormat = 1
objMail.MailFormat = 1
objMail.From=mittente
objMail.To=destinatario
objMail.Subject=oggetto
objMail.Body=email
objMail.Send
Set objMail = nothing
end if
%>
ma nn mi invia niente.....sicuramente mi mancano degli script.
il contenuto di send.asp é:
<%
Set cn = Server.CreateObject("ADODB.Connection")
%><%
Set rs = Server.CreateObject("ADODB.Recordset")
strSQL="SELECT Email FROM Mailing ORDER BY Email"
rs.Open strSQL,cn
tipo=request("Tipo")
email=request("Email")
mittente=request("Mittente")
oggetto=request("Oggetto")
if tipo="html" then
do while not rs.eof
Set Config = Server.CreateObject("CDO.Configuration")
Set Fields = Config.Fields
Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ' cdoSendUsingPort
Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.verdifirenze.it"
Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
' ************************************ DA MODIFICARE
Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "info@verdifirenze.it"
' ************************************ DA MODIFICARE
Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "verdi"
Fields.Update
Set objMail = Server.CreateObject("CDO.Message")
Set objMail.Configuration = Config
objMail.To = rs("Email")
objMail.From = mittente
objMail.Subject = oggetto
objMail.HTMLBody = email
objMail.Send
set objMail = Nothing
Set Fields = Nothing
Set Config = Nothing
rs.movenext
loop
else
do while not rs.eof
Set Config = Server.CreateObject("CDO.Configuration")
Set Fields = Config.Fields
Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ' cdoSendUsingPort
Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.verdifirenze.it"
Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
' ************************************ DA MODIFICARE
Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "info@verdifirenze.it"
' ************************************ DA MODIFICARE
Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "verdi"
Fields.Update
Set objMail = Server.CreateObject("CDO.Message")
Set objMail.Configuration = Config
objMail.To = rs("Email")
objMail.From = mittente
objMail.Subject = oggetto
objMail.TextBody = email
objMail.Send
set objMail = Nothing
Set Fields = Nothing
Set Config = Nothing
rs.movenext
loop
end if
set cn = nothing
set rs = nothing
%>
cosa devo modificare nella pagina email.asp.
GRAZIE

Rispondi quotando
