codice:
<!--#include file="inc/mailobject.asp"-->
<link rel="stylesheet" href="CSS/Format.css" type="text/css" />
<%
Response.Buffer = True
Dim strPagina, strPagina1
strpagina1 = Server.Execute("CorpoMail.asp") 'qui metto il contenuto della news letter che pesco dal DB in base alla data e al numero
strpagina = response.Write(strPagina1)
ConnectDB()
connectrst()
strSQL = "SELECT * FROM subscriber_list" 'indirizzi mail a cui andrà inviata la mail
adoRst.Open strSQL, adoCon, 1, 1
While Not adoRst.EOF
Dim strToEmail, strFromEmail, strSubject, strFormat, strMessage, MailBody
strFormato = "HTML"
strAdminEmail_ID = "admin@xxxx.it"
strSoggetto = "Newsletter - Progetto vxyz"
strToEmail = adoRst("Email")
strFromEmail = strAdminEmail_ID
strSubject = strSoggetto
strFormat = strFormato
MailBody = (strpagina)
Call SendMail(strToEmail, strFromEmail, strSubject, strFormat, MailBody)
adoRst.MoveNext
Wend
adoRst.Close
Set adoRst = Nothing
response.redirect("ConfermaRegistrazioneMini.asp")
%>
codice:
<%
Dim strDataInvio, strNumeroNews, MailBody, CorpoMail, NotizieInterne, strContaAllegati, strTitolo, strStrillo, strLink, strDataNews, strCategoriaNotizia
strDataInvio = request.form("DataInvio")
strNumeroNews = request.form("NumeroNews")
ConnectDB()
connectRS()
strSQL = "SELECT t_News.IdNews, t_News.Evidenza, t_News.Straordinaria, t_News.Pertinente, t_News.Titolo, t_News.Strillo, t_News.Titolarita, t_News.RealtaCoinvolte, t_News.Luogo, t_News.DoveRivolgersi, t_News.Referente, t_News.Link, t_News.DataNews, t_News.CategoriaNotizia, t_News.Pubblicazione, t_News.DataPubblicazione, t_News.Comuni, t_News.Enti, t_News.Invio, t_News.DataInvio, t_News.utenteinserimento, t_News.DataSalvataggio, t_News.utentemodifica, t_News.DataModifica, t_News.DataServer, t_News.NumeroNews, t_News.NumeroNews, t_News.DataInvio, Count(Allegati.Id) AS ConteggioDiId FROM t_News LEFT JOIN Allegati ON t_News.IdNews = Allegati.IdNews GROUP BY t_News.IdNews, t_News.Evidenza, t_News.Straordinaria, t_News.Pertinente, t_News.Titolo, t_News.Strillo, t_News.Titolarita, t_News.RealtaCoinvolte, t_News.Luogo, t_News.DoveRivolgersi, t_News.Referente, t_News.Link, t_News.DataNews, t_News.CategoriaNotizia, t_News.Pubblicazione, t_News.DataPubblicazione, t_News.Comuni, t_News.Enti, t_News.Invio, t_News.DataInvio, t_News.utenteinserimento, t_News.DataSalvataggio, t_News.utentemodifica, t_News.DataModifica, t_News.DataServer, t_News.NumeroNews, t_News.NumeroNews, t_News.DataInvio HAVING (((t_News.DataInvio)=#"&strDataInvio&"#) AND ((t_News.NumeroNews)="&strNumeroNews&"))"
rs.Open strSQL, adocon, 3, 3
Intestazione = ("<font face=""Verdana, Arial, Helvetica, sans-serif"" color=""#000000"" size=""2""><fieldset style=""border-color:#0000FF"" ><legend> <img src=""http://www.xxxxxx.it/Images/LogoPartecipazione.jpg"" width=""150"" /> </legend><br /><br /><br />")
response.Write(Intestazione)
i=1
do until (rs.eof)
strContaAllegati = rs("ConteggioDiId")
strTitolo= rs("Titolo")
strStrillo= rs("Strillo")
strLink= rs("Link")
strDataNews= rs("DataNews")
strCategoriaNotizia= rs("CategoriaNotizia")
If strCategoriaNotizia = 1 Then
strCategoriaNotizia = "<img src=""http://www.xxxxxx.it/images/Mani_cuore.png"" border=""0"" width=""160"" height=""116"">"
elseif strCategoriaNotizia = 2 Then
strCategoriaNotizia = "<img src=""http://www.xxxxxx.it/images/Seminari.png"" border=""0"" width=""160"" height=""116"">"
elseif strCategoriaNotizia = 3 Then
strCategoriaNotizia = "<img src=""http://www.xxxxxx.it/images/Registri_Libri.png"" border=""0"" width=""160"" height=""116"">"
elseif strCategoriaNotizia = 4 Then
strCategoriaNotizia = "<img src=""http://www.xxxxxx.it/images/Bandi_Finanziamenti.png"" border=""0"" width=""160"" height=""116"">"
elseif strCategoriaNotizia = 5 Then
strCategoriaNotizia = "<img src=""http://www.xxxxxx.it/images/Studi_Ricerche.png"" border=""0"" width=""160"" height=""116"">"
elseif strCategoriaNotizia = 6 Then
strCategoriaNotizia = "<img src=""http://www.xxxxxx.it/images/Eventi_Iniziative.png"" border=""0"" width=""160"" height=""116"">"
elseif strCategoriaNotizia = 7 Then
strCategoriaNotizia = "<img src=""http://www.xxxxxx.it/images/ComunicazioniOrganizzative.png"" border=""0"" width=""160"" height=""116"">"
elseif strCategoriaNotizia = 8 Then
strCategoriaNotizia = "<img src=""http://www.xxxxxx.it/images/Altre_Categorie.png"" border=""0"" width=""160"" height=""116"">"
end if
NotizieInterne = ("<table><tr><td rowspan=""6"" valign=""top""><p>"&strCategoriaNotizia&"</p></td><td class=""testoMaiuscolo""> <br />"&strTitolo&" </td></tr> <tr> <td class=""testo"">"&strStrillo&" </td> </tr><tr><td class=""testo"">Per questa notizia sono presenti: "&strContaAllegati&" allegati</td> </tr> <tr> <td width=""650""> <div align=""right""><a href=http://"&strLink&"><img src=""http://www.xxxxxx.it/Images/bottone_approfindisci.png"" width=""40"" border = ""0"" /></a> APPROFONDISCI</div> </td> </tr><tr><td colspan=""2""><hr width=""100%"" color=""#FFCC00""/></td></tr> </table>")
response.Write(NotizieInterne)
i=i+1
rs.movenext
loop
Dim Chiusura
Chiusura = ("</fieldset>")
response.Write(Chiusura)
rs.close
set rs=nothing
adocon.close
set adocon=nothing
%>