?
Solved

Scheduling an email using Windows Scheduler in asp.net

Posted on 2011-09-09
5
Medium Priority
?
449 Views
Last Modified: 2012-06-21
I want to Scheduling an email using Windows Scheduler in asp.net.

I want to mail automatically send on 1 week and 1 month.

Please give me code or detail how to do in asp.net.

Please give me as soon as possible.

Thanking you
0
Comment
Question by:citadelind
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 8

Expert Comment

by:Amitabh Singh
ID: 36510431
hi
i just able to provide you link because i never did this via ASP.NET

have a look to the post below for code

http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_22966978.html?sfQueryTermInfo=1+10+30+asp.net+mail+send



Hear is a Microsoft doc for same staff

http://msdn.microsoft.com/en-us/magazine/cc163821.aspx

0
 
LVL 8

Expert Comment

by:Amitabh Singh
ID: 36510452
and why not just use the regular windows scheduler to  sends the emails via VBS ? Is there a reason it needs to be launched from within ASP.NET originally?
0
 
LVL 8

Expert Comment

by:Amitabh Singh
ID: 36510476
VBS Example

Dim objOutl
Set objOutl = CreateObject("Outlook.Application")
Set objMailItem = objOutl.CreateItem(olMailItem)
'comment the next line if you do not want to see the outlook window
objMailItem.Display
strEmailAddr  = "me.me@you.com"
objMailItem.Recipients.Add strEmailAddr
objMailItem.Body = "Hi"
objMailItem.Attachments.Add "file.xml"
objMailItem.Send
Set objMailItem = nothing
Set objOutl = nothing

Open in new window

0
 

Author Comment

by:citadelind
ID: 36515146
Please give me specific code so i can apply easily

Or Give me some link so i will see that
0
 
LVL 8

Accepted Solution

by:
Amitabh Singh earned 2000 total points
ID: 36515248
ok   then do it like this , Steps are fallowing !

Login to your IIS (web server) and Install SMTP on it .
Procedures
--------------------------------------------------------------------------------------------
To install the SMTP service
1.From the Start menu, click Control Panel.

2.Double-click Add or Remove Programs.

3.From the left pane, click Add/Remove Windows Components.

4.From the Components list, click Application Server, and then click Details.

5.From the Subcomponents of Application Server list, click Internet Information Services (IIS), and then click Details.

6.From the Subcomponents of Internet Information Services (IIS) list, select the SMTP Service check box.

7.Click OK.

8.Click Next. You might be prompted for the Windows Server 2003 family CD or the network install path and Click Finish.
--------------------------------------------------------------------------------------------
HTML mail configuration
--------------------------------------------------------------------------------------------
generate a HTML page via ASP.NET which  you want in your email in body and place in local storage , example
i place my html file in c:/week/Doc1.htm and c:/month/Doc1.htm

now .. now create a text file inside c:/week/ place fallowing code in it and save as send.vbs
 
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Test HTML Code"
objMessage.From = "repo@send.local"
objMessage.To = "me@send.local"
objMessage.HTMLBody = "<h1>HTML Mail test.</h1>"
objMessage.CreateMHTMLBody "file://c:/week/Doc1.htm"
objMessage.Send

Open in new window


and now same for month
create a text file inside c:/month/ place fallowing code in it and save as send.vbs
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Test HTML Code"
objMessage.From = "repo@send.local"
objMessage.To = "me@send.local"
objMessage.HTMLBody = "<h1>HTML Mail test.</h1>"
objMessage.CreateMHTMLBody "file://c:/month/Doc1.htm"
objMessage.Send

Open in new window

now go to windows schedule task create 2  1st task will run every week and run  fallowing command cscript c:/week/send.vbs
run the task and check if you received mail

now do the same for month
create a new task that will run every month and run  fallowing command cscript c:/month/send.vbs
run the task and check if you received mail
------------------------------------------------------------------------------------------------------
Note : be remember your ASP.net need to replace (or delete old one and create a new file ) c:/week/Doc1.htm and c:/month/Doc1.htm every time .
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
As cyber crime continues to grow in both numbers and sophistication, a troubling trend of optimization has emerged over the last year.
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question