Salve a tutti,ho un piccolo problema nella conversione da CDONTS in CDOSYS di questo file visto che sul server 2003 in componente CDONTS nn esiste piu...vi posto il codice..
<%
function SendMail(sTo, sFrom, sPriority, sSubject, sBody, bHTML){
cdoLow = 0;
cdoNormal = 1;
cdoHigh = 2;
CdoBodyFormatText = 1;
CdoMailFormatText = 1;
var oMailMessage = new ActiveXObject("aspmail.NewMail");
oMailMessage.To = sTo;
oMailMessage.Value("Reply-To") = sFrom;
oMailMessage.From = sFrom;
oMailMessage.Subject= sSubject;
if (sPriority == "LOW"){
oMailMessage.importance = cdoLow;
} else if(sPriority == "HIGH") {
oMailMessage.importance = cdoHigh;
} else {
oMailMessage.importance = cdoNormal;
}
if (bHTML==1) {
oMailMessage.BodyFormat = CdoBodyFormatText;
oMailMessage.MailFormat = CdoMailFormatText;
} else {
oMailMessage.BodyFormat = 0;
oMailMessage.MailFormat = 0;
}
oMailMessage.Body = sBody;
oMailMessage.Send();
return 1;
}
if (Request("conferma")=="OK") {
curDir = Server.MapPath("gest.mdb");
connNews = Server.CreateObject("ADODB.Connection");
connNews.Open("DBQ=" + curDir + ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;");
re = new RegExp("'", "g");
cUserName = new String( Request("Username") );
cUserName = cUserName.substr(0,28);
cUserName = cUserName.replace( re, "-");
cPassword = new String( Request("Password") );
cPassword = cPassword.substr(0,28);
cPassword = cPassword.replace( re, "-");
cEmail = Request(String("email"));
cview_dati = Request(String("view_dati"));
cview_profilo = Request(String("view_profilo"));
cmessaggi_check = Request(String("messaggi_check"));
cStatus = Request("Status");
today=new Date();
// cData = today.getDate()+"/"+(today.getMonth()+1)+"/"+today.getYear();
cData = today.getDate()+"/"+(today.getMonth()+1)+"/"+today.getYear()+" "+today.getHours()+"."+today.getMinutes()+"."+today.getSeconds();
rsDBASE = Server.CreateObject("ADODB.Recordset");
rsDBASE.ActiveConnection = connNews;
rsDBASE.Source = "SELECT * FROM Utenti WHERE (Username = '" + cUserName + "') or (email='" +cEmail+ "')";
rsDBASE.LockType = 2;
rsDBASE.Open();
cRandom=Math.ceil( Math.random()*32323212 );
if (rsDBASE.EOF)
{
rsDBASE.AddNew();
rsDBASE("Username")=cUserName;
rsDBASE("Password")=cPassword;
rsDBASE("Email")=cEmail;
rsDBASE("view_dati")=cview_dati;
rsDBASE("view_profilo")=cview_profilo;
rsDBASE("messaggi_check")=cmessaggi_check;
rsDBASE("Status")=cStatus;
rsDBASE("Data")=cData;
rsDBASE("Attivazione")= cRandom;
rsDBASE.Update();
cMessaggio = "Per attivare il tuo account sul sito clicca questo link: http://www.ciccio.it/account.asp?id="+cRandom+"";
SendMail( cEmail,"[email protected]","HIGH","Attivazione",cMessaggio, 0 );
%>
<%
function SendMail(sTo, sFrom, sPriority, sSubject, sBody, bHTML){
cdoLow = 0;
cdoNormal = 1;
cdoHigh = 2;
CdoBodyFormatText = 1;
CdoMailFormatText = 1;
var oMailMessage = new ActiveXObject("aspmail.NewMail");
oMailMessage.To = sTo;
oMailMessage.Value("Reply-To") = sFrom;
oMailMessage.From = sFrom;
oMailMessage.Subject= sSubject;
if (sPriority == "LOW"){
oMailMessage.importance = cdoLow;
} else if(sPriority == "HIGH") {
oMailMessage.importance = cdoHigh;
} else {
oMailMessage.importance = cdoNormal;
}
if (bHTML==1) {
oMailMessage.BodyFormat = CdoBodyFormatText;
oMailMessage.MailFormat = CdoMailFormatText;
} else {
oMailMessage.BodyFormat = 0;
oMailMessage.MailFormat = 0;
}
oMailMessage.Body = sBody;
oMailMessage.Send();
return 1;
}
if (Request("conferma")=="OK") {
curDir = Server.MapPath("gest.mdb");
connNews = Server.CreateObject("ADODB.Connection");
connNews.Open("DBQ=" + curDir + ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;");
re = new RegExp("'", "g");
cUserName = new String( Request("Username") );
cUserName = cUserName.substr(0,28);
cUserName = cUserName.replace( re, "-");
cPassword = new String( Request("Password") );
cPassword = cPassword.substr(0,28);
cPassword = cPassword.replace( re, "-");
cEmail = Request(String("email"));
cview_dati = Request(String("view_dati"));
cview_profilo = Request(String("view_profilo"));
cmessaggi_check = Request(String("messaggi_check"));
cStatus = Request("Status");
today=new Date();
// cData = today.getDate()+"/"+(today.getMonth()+1)+"/"+today.getYear();
cData = today.getDate()+"/"+(today.getMonth()+1)+"/"+today.getYear()+" "+today.getHours()+"."+today.getMinutes()+"."+today.getSeconds();
rsDBASE = Server.CreateObject("ADODB.Recordset");
rsDBASE.ActiveConnection = connNews;
rsDBASE.Source = "SELECT * FROM Utenti WHERE (Username = '" + cUserName + "') or (email='" +cEmail+ "')";
rsDBASE.LockType = 2;
rsDBASE.Open();
cRandom=Math.ceil( Math.random()*32323212 );
if (rsDBASE.EOF)
{
rsDBASE.AddNew();
rsDBASE("Username")=cUserName;
rsDBASE("Password")=cPassword;
rsDBASE("Email")=cEmail;
rsDBASE("view_dati")=cview_dati;
rsDBASE("view_profilo")=cview_profilo;
rsDBASE("messaggi_check")=cmessaggi_check;
rsDBASE("Status")=cStatus;
rsDBASE("Data")=cData;
rsDBASE("Attivazione")= cRandom;
rsDBASE.Update();
cMessaggio = "Per attivare il tuo account sul sito clicca questo link: http://www.ciccio.it/account.asp?id="+cRandom+"";
SendMail( cEmail,"[email protected]","HIGH","Attivazione",cMessaggio, 0 );
%>