3
Contributors
10
Replies
39
Views
3 Years
Discussion Span
Last Post by gahhon
Featured Replies
  • 1

    > it will automatically send email to several email address. (Without any end-users fire the events) So obvisouly, this wouldnt work well within an asp.net application because you would need sometype of event to occur. You could run a procedure in the background every time a web page is accessed, … Read More

0

Your question needs clarification. You are trying to send an email to a specific email address? What do you mean automatically? During a postback, submit button, some other event?

0

No, sorry for that i didn't type clearly.
Is similiar to reminder function, it will automatically send email to several email address. (Without any end-users fire the events)
Just is automatic send the email when is date is today or etc.

1

it will automatically send email to several email address. (Without any end-users fire the events)

So obvisouly, this wouldnt work well within an asp.net application because you would need sometype of event to occur. You could run a procedure in the background every time a web page is accessed, but that is not an appropriate or effecient solution.

A stand-alone .net application would work better and you can run it as a service on your server.

However, the approach that I have always taken is to handle this process from MS SQL as a re-occuring job (via the SQL Server Agent). For example, I would simply write a stored procedure that would query my DB tables, and generate the HTML response and loop through my list of target users and send mail directly to each target user.

If you use SQL to manage this process, this is what I've used within my stored procedure...

sp_send_dbmail (Transact-SQL)

Edited by JorgeM

0

The link is useful for me, but how to create the SQL Server Agent? or any step to do first before coding the procedure?

0

Oh.. I suspect you are running SQL Express. :-(.

Sorry about forgetting to mention its not included in that version.

The other option is to compile a .net app, and run it on schedule.

You could also do this in asp.net... Create a page that is for the purpose of running this process, no output to the user. Then create a cron job (free services online) that will call this page on schedule. On page load event, run the code to email.

0

Any sample able to search online or tutorials?
Will this schedule will automatically execute whenever i doesn't running the page?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.