|
-
Feb 8th, 2013, 01:47 AM
#1
Thread Starter
Addicted Member
Sending report using auto email in windows application?
I want to get code that works for sending auto email.
i want to send reports automatically per month.
i am developing rent management system, i want to know the report between two dates and i generate it in my application, now i want to send it to my email automatically every month, could someone do it how it could be?
first how can i send plain messages automatically every hour?
then my second question how can i send it with auto generate report and attachment?
please my knowledge is limited help me in coding it? thanks
-
Feb 8th, 2013, 03:45 AM
#2
Re: Sending report using auto email in windows application?
If you want to do something every hour then you'd want to use a Timer and handle the appropriate event. You could use a Windows.Forms.Timer and handle its Tick event but you may be better off using a Timers.Timer and handling its Elapsed event. That's because the latter raises events on secondary threads by default, which means that your report generation and emailing won't freeze the UI.
As for sending the email, check out the documentation for the System.Net.Mail.Attachment class, which has a code example.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|