I want to send email on certain calendar days say 20th of everymonth. How can i do this?
The problem is i am not so sure that this appliction will be browsed by users on 20th of the month. If not opened on this day, perhaps the mail can not be sent. Is there any way i can send it even if application is not running.
Thanks.
For this requirement I will write Windows Service Application. Service will run on server without user intervention and will be dependent on users to login.
High level Action Steps will be
Store Calendar Days
Allow Service to access this store and send emails (using predefined template?) on requested Date time.
Related
I stumbled with a legacy application in C# that creates an item, saves it, fetches the creation date and deletes it right after, using ExchangeService api. All this to simply get the current server time.
There's gotta be a better way of doing this, but I went through all the online docs and did a few searches about it and couldn't find anything.
So, simple question: how to fetch Exchange server current datetime using C#?
Thanks in advance.
Where is the application running ? eg if its running on the server or any domain connected machine then querying the time from the Exchange server should be redundant. Eg Windows servers within a Domain should sync there time via Windows time service https://learn.microsoft.com/en-us/windows-server/networking/windows-time-service/how-the-windows-time-service-works. And usually you would setup a DC to sync the time from NTP so every machine should have same time (in theory).
The Exchange API's don't have an time methods but any request to an Exchange server should return the Date Header in the Response headers as it a mandatory property in Http https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.18
I have windows 2003 server with about 15 C# windows services sending emails randomly based on some complex business logic. It is a very difficult to find out which application sending emails to whom at what time.
For additional info, the server has McAfee client installed and configured by admin that which application can send emails.
Is there any way I can find out which application is sending email to whom?
If you can't store the information required in a database, then generate log files specific to your need. I'm certain you don't need code to tell you how to have your C# services generate log files that contain all the pertinent information (date/time, service name, email address, type/id or some content identifier). You can then use the logs to generate whatever reporting you need, and if build with configuration, you can turn off the logging once you have enough information to answer the question.
Few days ago I have a website in which i send mail automatically by using Task Scheduler.
I have Created a console based application in it and send mail using task Scheduler at regular interval. But Now the site owner is moving that site from virtual hosting to shared hosting.
And they are not allowing to schedule task. Neither they are providing Sql Server agent and not allowing to Create Window Services so what option i have to send mails at regular interval.
and also i have created that site like a year ago so it will be difficult to make much changes in that site.
Can anyone suggest me what option i have to send mails.
i want a continously running thread in my web application for sending mail to admin if the logged complaint of the user in not solved by technician within 24 hours.
i am able to send mail to administrator
i just want a watch on database for unsolved issues with timespan of more than 24 hours and inform to administrator about the same
how can i perform it. any ideas
Create an aspx page/asmx service to check the database and send email providing appropriate check in the page/service. This page/service can then be called using PowerShell script on the server, and that powershell script can be scheduled to run in task schedular using specified intervals. Hope this shall acheive what you wants.
The right way to do it would be to write a Windows Service which will monitor the database and send emails out.
If your asp.net web application uses sql server, which i imagine it does, i would reccomend creating a sql agent job which executes some sql with the business logic you desire, and sends emails using the built in sql server email sending functionality
SQL Server Agent Mail
1) Windows service which will monitor the table
2) SQL Job
1) In my application am scheduling meetings. 2) am collecting payment installments for purchase of an item (it has payment due dates). 3) Now I want to send notifications to the users i) for schedule events I need to send notification 5 min before the meeting time ii) for payment dues I need to send notifications from one week before to till payment due date
My application is a webapplication
1) In my application am scheduling meetings.
Store the scheduled meeting date somewhere persistent (e.g. in a database).
2) am collecting payment installments for purchase of an item (it has payment due dates).
Store the payment due date somewhere persistent (e.g. in a database).
3) Now I want to send notifications to the users
Send notification by email? Or send notification via HTML to their browser when they navigate to your webapplication?
i) for schedule events I need to send notification 5 min before the meeting time
Occasionally (e.g. once/minute) query your database to see which users have meetings scheduled within the next 5 minutes.
ASP.NET isn't great for something like this, because there is no guarantee that your application will be running at the moment it needs to perform the necessary processing.
It would be better to write either a Windows Service or a console app (triggered by Windows Task Scheduler). The service/app could use a timer (or poll/sleep loop) to check for items that need to be processed.
You need a scheduling framework like Quartz.Net