Originariamente inviato da krakus
Salve
Ho un piccolo problema con la creazione di una newsletter!
utilizzo lo script che ho trovato su html nella sezione asp,
.....
<%
Dim con, rs, strSql, objMail
If Request.Form("cmdSubmit") <> "" Then
'The user has submitted the page, so process the Newsletter subscription request
'Connect to the database
Set con = GetDBConnection()
'Get all email addresses in the database
strSql = "SELECT Email FROM Subscribers"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strSql, con, 1, 2
If rs.EOF Then
'MODIFY the text below displays when no subscribers exist
%>
There are no subscribers to the newsletter.
<%
'Clean up database objects
rs.Close()
Set rs = Nothing
con.Close()
Set con = Nothing
Response.End
End If
While Not(rs.EOF)
Set objMail = Server.CreateObject("CDONTS.NewMail")
'MODIFY the following email address will appear as the from address for the email.
objMail.From = "newsletter@yoursite.com"
objMail.To = rs("Email")
objMail.Body = Request.Form("txtEmail")
objMail.Send
rs.MoveNext()
Wend
'MODIFY the text below displays when all the emails have been sent
%>
The emails have been sent.
<%
'Clean up database objects
rs.Close()
Set rs = Nothing
con.Close()
Set con = Nothing
Else
'MODIFY the text below is displayed when the page is first loaded.
%>
<form action="send.asp" method="post" id=form1 name=form1>
<div align="center">
Enter the email message to send:
<textarea name="txtEmail" cols="50" rows="30"></textarea>
<input type="submit" name="cmdSubmit" value="Submit">
</div>
</form>
<%
End If
%>
il mio problema è il seguente...
il database che uso ha il campo email NON obbligatorio
sono presenti circa 1500 campi con 1000 email.
>>database
id nome cognome email
1 aaaaa bbbbbbb
mail@mail.ii
2 bbbbb ccccccc << manca email
3 zzzzz xxxxxx
aaa@bb.cc
ecc.
come faccio a modificare lo script per saltare lo spazio tra le email vuoto
e analizzare i campi successivi, devo impostare anche il Timeout per la pagina come faccio?
P.S
altrimrnti mi potreste consigliare un programmino free per l'invio di newsletter dal mio pc.