Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
I am trying to send emails to users at maybe on the 7th that they hvnt paid their installments but not send emails to those that hv paid. I hv read about using window service but my problems are

0. Can I integrate it with my web application

1. I hv no control of the server it'd the school server.

I hv also read using hangfire but I dnt get it

What I have tried:

I am trying using windows services but my problem is that will I be able to integrate with my existing MVC application
Posted
Updated 14-Jul-19 1:58am
v2
Comments
Suvendu Shekhar Giri 5-Jul-16 2:41am    
Would like to request you to try something first, take the suggestion from Google result.
If you don't have access to the server then how are you deploying your application there?
Member 12618795 5-Jul-16 5:32am    
I might be using the wrong term when I say I dnt have access to the server, but if I have to configure the server I dnt hv the privileges to do that..... what I can do is just deploy and view my deployed files on the server
Suvendu Shekhar Giri 5-Jul-16 5:40am    
In that case try hangfire (although I haven't used it yet but seems to help your resolve your issue)
Member 12618795 5-Jul-16 6:25am    
Thank you.....il try that
Richard MacCutchan 5-Jul-16 3:41am    
hvnt, hv, dnt, it'd
Are these words?

If your DBA was smart (or even just a little self-aware), he will have turned off the ability to send emails from the database. You can ask him, but be prepared for a negative response.

Sending emails from a web site is beyond trivial. When the user logs on, send the email to him if appropriate, or when an admin logs on, he can be notified that there are pending emails to be sent, and he can click a button to send all of the pending emails at the same time. Caveat - either of these two options require that a human log onto the web site in order to send the emails.

Your only real option is to create a Windows service that performs the neccessary check on a daily basis (hopefully when the database server is least busy), and sends any emails that need to be sent. This will require a number of moving parts to implement, but it is by far the best solution because a windows service runs even when nobody is logged onto the server, and requires absolutely no human intervention.

Advice based on comments you've received:

"Shorthand" for you is gibberish to us. You're on a programmer's forum, asking for *our* help. It's hard enough for us to deal with unintentionally broken English (and we do it EVERY DAY), we don't need people INTENTIONALLY breaking English. Use complete words (even if they might be the wrong words), because not doing so just pisses off the adults.

Finally, every real programmer knows that all lists start with 0. I'm going to go ahead and fix your crass mistake, but please remember this in the future.
 
Share this answer
 
Comments
Afzaal Ahmad Zeeshan 14-Jul-19 8:00am    
An even better option would have been to create groups or lists or email recipients on your SMTP server and have your SMTP server do the job of sending mails. Why spoil CPU cores for database service, or the resources for web application to send the emails, when you can have your SMTP server do it in a much better way.

Groups can be used to send specialized emails as needed, and only members of that group would receive the emails—people with unverified emails, people who are in admin role, etc. etc. Querying the database would be an expensive idea.

Yes, removal or addition of the members to a group is a one time action, instead of a query that happens each time.
#realJSOP 14-Jul-19 8:08am    
My guess is that these emails are being sent to the site's users, NOT the network's users, so using groups would be - well - wrong. Therefore having the SMTP server do it is - well - wrong.
Dave Kreskowiak 14-Jul-19 10:10am    
3 years old.
#realJSOP 14-Jul-19 10:32am    
It was at the top of my list of latest unanswered questions.
MadMyche 14-Jul-19 12:45pm    
Same here
So you have an MVC application already & limited other access to servers.

What I would do is your option #3: Integrate into your existing web application.

1. Create a class for those who will get emails: InstallmentMissed
2. Create another class for InstallmentMissedLastRun
3. Create a Controller and an Action to utilize #1 & 2.
4. Create a scheduled task on some computer to hit the URL associated to #3
 
Share this answer
 
Comments
Dave Kreskowiak 14-Jul-19 10:10am    
3 years old.
MadMyche 14-Jul-19 12:45pm    
Obviously I did not see that before I replied

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900