Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sending email

1 view
Skip to first unread message

Paulo

unread,
Feb 26, 2008, 8:26:08 AM2/26/08
to
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 = "fatur...@carrinhoshercules.com.br";
sTo = "pa...@eris.com.br"; //
reader["EMAIL"].ToString()

SendEmail sFrom , sTo , sAssunto, sCorpo;

reader.Read(); // lê próximo registro
}
reader.Close(); // fecha cursor
}


George Ter-Saakov

unread,
Feb 26, 2008, 9:03:12 AM2/26/08
to
You must come up with some scheduling.

If you have an ASPX page that you need to run at 10 PM, then you need to
fire up IE at 10 PM everyday and hit that page :)

Or you can use a Windows scheduler to hit that url... Bonus is you can do it
from your home PC if the server scheduler is not available to you.

George.


"Paulo" <prb...@uol.com.br> wrote in message
news:OliqpsHe...@TK2MSFTNGP02.phx.gbl...

Paulo

unread,
Feb 26, 2008, 9:11:06 AM2/26/08
to
How can I fire up IE to some page? Show me how please...

Thanks

"George Ter-Saakov" <gt-...@cardone.com> escreveu na mensagem
news:ehXEUBIe...@TK2MSFTNGP06.phx.gbl...

Mark Rae [MVP]

unread,
Feb 26, 2008, 9:31:48 AM2/26/08
to
"Paulo" <prb...@uol.com.br> wrote in message
news:u%23TXyFIe...@TK2MSFTNGP03.phx.gbl...

> How can I fire up IE to some page? Show me how please...

That's what hyperlinks are for...

Click the following hyperlink: http://www.microsoft.com - what happened...?


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Paulo

unread,
Feb 26, 2008, 9:37:47 AM2/26/08
to
HeHe... that was very funny!

How can windows be scheduled to start up IE at some URL ?

ie.exe 'http://something/page.aspx' ????????????


"Mark Rae [MVP]" <ma...@markNOSPAMrae.net> escreveu na mensagem
news:e%23JXSRIe...@TK2MSFTNGP06.phx.gbl...

Mark Rae [MVP]

unread,
Feb 26, 2008, 9:49:07 AM2/26/08
to
"Paulo" <prb...@uol.com.br> wrote in message
news:eMuNsUIe...@TK2MSFTNGP05.phx.gbl...

>>> How can I fire up IE to some page? Show me how please...
>>
>> That's what hyperlinks are for...
>>
>> Click the following hyperlink: http://www.microsoft.com - what
>> happened...?
>

> HeHe... that was very funny!

Wasn't meant to be funny...

> How can windows be scheduled to start up IE at some URL ?
>
> ie.exe 'http://something/page.aspx' ????????????

Create a new scheduled task and specify 'http://something/page.aspx' as the
task to run...

sloan

unread,
Feb 26, 2008, 10:58:07 AM2/26/08
to
You might find this article useful.

http://www.codeproject.com/KB/aspnet/ASPNETService.aspx

I've wanted to try it..but haven't had time.

"Paulo" <prb...@uol.com.br> wrote in message

news:OliqpsHe...@TK2MSFTNGP02.phx.gbl...

siccolo

unread,
Feb 26, 2008, 6:36:03 PM2/26/08
to
if you're on SQL Server, why not have SQL Server send emails at 10pm?

.. more at http://www.siccolo.com/articles.asp

0 new messages