P
Paulo
Hi, I need to send email everyday at 10PM. I've already a aspx page wich
reads the database and collects some data to be sent...
How can I configure the server to execute that asp page everyday? What do
you suggest?
Thanks in advance!
---------------------------------
sQuery = "select
n.NF,c.FANTASIA,n.DT_FAT,co.DATA_COLETA,n.DESP_QT,n.DESP_ESP,
t.FANTASIA as TRANSPORTADORA, t.TELEFONE as TEL_TRANSP,c.EMAIL
from (((NF_CAB n inner join CLIENTE c on n.CODECLI=c.CODECLI)
inner join COLETAS_GERAL co on n.NF=co.G_NRNOTA and
n.EMITENTE=co.EMITENTE)
left outer join CLIENTE t on co.CODTRANS=t.CODECLI)
where year(co.DATA_COLETA)=YEAR(getdate()) and
month(co.DATA_COLETA)=month(getdate()) and
day(co.DATA_COLETA)=day(getdate()) and co.STATUS=1 and n.DESP_FRETE=1" ;
try
{
SqlDataReader reader;
reader = SqlHelper.ExecuteReader(connectionString,
CommandType.Text, sQuery );
reader.Read(); // lê primeiro registro
while ( reader != null ) // verifica se têm dados
{
sAssunto = 'HERCULES: nota fiscal ' +
reader["NF"].ToString() + ' expedida';
sCorpo = 'Prezado(a) ' +
reader["FANTASIA"].ToString() + ', a sua nota fiscal de numero ' +
reader["NF"].ToString() + ' foi coletada
dia ' + reader["DATA_COLETA"].ToString() +
' pela transportadora ' +
reader["TRANSPORTADORA "].ToString() +
' (telefone: ' +
reader["TEL_TRANSP"].ToString() + '), constando ' +
reader["DESP_QT "].ToString() + ' ' +
reader["DESP_ESP"].ToString() ;
sFrom = "(e-mail address removed)";
sTo = "(e-mail address removed)"; //
reader["EMAIL"].ToString()
SendEmail sFrom , sTo , sAssunto, sCorpo;
reader.Read(); // lê próximo registro
}
reader.Close(); // fecha cursor
}
reads the database and collects some data to be sent...
How can I configure the server to execute that asp page everyday? What do
you suggest?
Thanks in advance!
---------------------------------
sQuery = "select
n.NF,c.FANTASIA,n.DT_FAT,co.DATA_COLETA,n.DESP_QT,n.DESP_ESP,
t.FANTASIA as TRANSPORTADORA, t.TELEFONE as TEL_TRANSP,c.EMAIL
from (((NF_CAB n inner join CLIENTE c on n.CODECLI=c.CODECLI)
inner join COLETAS_GERAL co on n.NF=co.G_NRNOTA and
n.EMITENTE=co.EMITENTE)
left outer join CLIENTE t on co.CODTRANS=t.CODECLI)
where year(co.DATA_COLETA)=YEAR(getdate()) and
month(co.DATA_COLETA)=month(getdate()) and
day(co.DATA_COLETA)=day(getdate()) and co.STATUS=1 and n.DESP_FRETE=1" ;
try
{
SqlDataReader reader;
reader = SqlHelper.ExecuteReader(connectionString,
CommandType.Text, sQuery );
reader.Read(); // lê primeiro registro
while ( reader != null ) // verifica se têm dados
{
sAssunto = 'HERCULES: nota fiscal ' +
reader["NF"].ToString() + ' expedida';
sCorpo = 'Prezado(a) ' +
reader["FANTASIA"].ToString() + ', a sua nota fiscal de numero ' +
reader["NF"].ToString() + ' foi coletada
dia ' + reader["DATA_COLETA"].ToString() +
' pela transportadora ' +
reader["TRANSPORTADORA "].ToString() +
' (telefone: ' +
reader["TEL_TRANSP"].ToString() + '), constando ' +
reader["DESP_QT "].ToString() + ' ' +
reader["DESP_ESP"].ToString() ;
sFrom = "(e-mail address removed)";
sTo = "(e-mail address removed)"; //
reader["EMAIL"].ToString()
SendEmail sFrom , sTo , sAssunto, sCorpo;
reader.Read(); // lê próximo registro
}
reader.Close(); // fecha cursor
}