Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Scheduling an email using Windows Scheduler in asp.net

Posted on 2011-09-09
5
Medium Priority
?
453 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
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

609 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