Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Very Urgent:i want to create a method in C#, in that i want to trigger a mail of containing data from the Store Procedure,the format of the data(PDF, Excel, or html content in the body of the mail), timing of email delivering its all depend on the user Input exa 1-> a customer want a mail daily at 10.30AM as the data is in PDF format exa 2-> a customer want a mail on weekly basis (every wednesday ) as excel format.

all the process should be done in a method.

What I have tried:

can anyone some suggestion, how to proceed
Posted
Updated 18-Sep-17 1:00am
v2
Comments
OriginalGriff 18-Sep-17 6:33am    
And?
What have you tried?
Where are you stuck?
What help do you need?

And it may be urgent to you, but it isn't to us. All that your stressing the urgency does is to make us think you have left it too late, and want us to do it for you. This annoys some people, and can slow a response. All questions are urgent to the person who want's an answer, so assuming yours is more urgent than any other is just arrogant and rude...
Graeme_Grant 18-Sep-17 6:46am    
Research, planning, then coding. Google Search is a good place to start.

IF you are on a tight deadline, and what someone to write it for you, there are plenty of developers that will do it for you: Hire Freelancers & Find Freelance Jobs Online - Freelancer[^]

1 solution

You need

  1. A scheduler that is triggering the sending
  2. Code that queries the settings (if not passed by the scheduler)
  3. Code that generates the reports in the required formats
  4. Code that sends mails with attachments
The last three points are not difficult to implement but the first one requires having a concept which depends on your general setup which we don't know. The simplest solution would by a periodically called event (e.g. every minute) that checks all accounts for their trigger time. But that would not scale well for many users.

Quote:
all the process should be done in a method
Putting all the above into one method would result in a quite large and nearly unmaintainable method. I hope you wanted to write module instead (e.g. containing the scheduler and a class for generating and sending mail that contains methods for the above listed tasks).
 
Share this answer
 

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