21 messaggi dal 15 febbraio 2006
CIAO A TUTTI!!!
AVREI BISOGNO DI UNA COSA CHE PER VOI... SARA' UN GIOCO DA RAGAZZI.

HO UNO SCIPT DI INVIO NEWSLETTER.
FUNZIONA CON SISTEMA CDDONS.

SU ALCUNI SERVER PERO' IL CDDONS NON FUNZIONA, QUINDI BISONGEREBBE CONVERTIRLO IN CDO.MESSAGE.

SCRIVO QUI SOTTO I CODICI DELLA PAGINA DOVE PENSO DEBBANO ESSERE APPORTARE LE MODIFICHE:

<!--#include file="custom.asp"-->
<%
'================================
'This script contains commonly used function
'================================

'Include configuration file (custom.asp)

'============================
'Get password from the file
'specified in custom.asp
Function GetPassword(Password)
set fs=server.CreateObject("Scripting.FileSystemObject")
'Pass variable is defined in custom.asp
set file=fs.OpenTextFile(Pass,1)
PassText=file.readline
file.close
If PassText=Password then
GetPassword=true
else
GetPassword=false
End If
'Deinitialize the variable
set file=nothing
set fs=nothing
End Function

'============================
'Set new password
'Pass variable is defined in custom.asp
Sub SetPassword(Password)
set fs=server.CreateObject("Scripting.FileSystemObject")
set file=fs.OpenTextFile(Pass,2)
file.writeline password
file.close
'Deinitialize the variable
set file=nothing
set fs=nothing
End Sub

'============================
'Fill the combo box with the
'contents of Category field
Sub FillCombo()

set Conn=server.CreateObject("ADODB.Connection")
Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
Conn.ConnectionString = "Data Source=" & dbpath
Conn.Open
set Rs=server.CreateObject("ADODB.Recordset")
rs.Open "select * from " & CatRc & " order by category",conn,1,3
'If there is no record then exit the sub
Response.Write rs.RecordCount
if not rs.RecordCount > 0 then exit sub

do while not rs.EOF
Response.Write "<option value='" & rs("catid") & "'>" & rs("category") & "</option>"
rs.MoveNext
loop

rs.Close
conn.Close

set rs=nothing
set conn=nothing
End Sub

'============================
'Check to see whether the same
'record exists or not
Function Verify(Rs,Catid,email)
set CloneRs=Rs.Clone
'Filter the recordset
CloneRs.Filter="email='" & email & "' and catid=" & catid
'If there is no record then exit the function
if not CloneRs.RecordCount >0 then
Verify=false
else
verify=true
end if

CloneRs.close
set CloneRs=nothing
End Function

'============================
'Send Mail to the users of the
'specified category
Function SendMail(logo,CatId,name,subject,message)
set Conn=server.CreateObject("ADODB.Connection")
Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
Conn.ConnectionString = "Data Source=" & dbpath
Conn.Open
set Rs=server.CreateObject("ADODB.Recordset")
Rs.Open "select * from " & MailRc & " where catid=" & catid,conn,1,3
'If there is no record then exit the function
if Rs.eof then
Response.Redirect "esito.asp?esito=0"
else

HTML = HTML & "<p align="" left "">"
HTML = HTML & "<img src=" & logo & "></p>"
HTML = HTML & "" & message &""

do while not rs.EOF



Set MailToSend = CreateObject("CDONTS.Newmail")'initialize the variable
MailToSend.TO = "<" & rs("email") & ">" 'Mail to.... enclose email address in the bracket
MailToSend.From = name ' 'Mail from
MailToSend.Subject = subject ' subject
MailToSend.Body = HTML ' message to send
MailToSend.Importance=1 ' priority of this message
MailToSend.BodyFormat = 0
MailToSend.MailFormat = 0
MailToSend.send ' send
Set MailToSend=nothing ' deinitialize the variable
rs.MoveNext 'Move next
loop
'How many mail sent
MailSent=rs.RecordCount

rs.Close
conn.Close
set rs=nothing
set conn=nothing
SendMail=MailSent
Response.Redirect "esito.asp?esito=1"
end if
End Function
%>



AIUTATEMI PLEASE...

GRAZIE


NIKI

Nikoletta

Torna al forum | Feed RSS

ASPItalia.com non è responsabile per il contenuto dei messaggi presenti su questo servizio, non avendo nessun controllo sui messaggi postati nei propri forum, che rappresentano l'espressione del pensiero degli autori.