preface In the previous topic, the database creation job plan is recorded to realize the scheduled execution of tasks. This article will record the use of Windows task scheduler to implement the function of sending emails at regular intervals.
environment
>Windows 10 system
tools
>VS 2015
Text
step1: Open VS2015, create a console application, write the code to be executed in the Main function, and F6 to generate the .exe file.
Note: The sender authentication credentials above are not the password for the email address. It is a verification certificate, which can be searched online.
Step2: Open Run and enter "taskschd.msc" - > OK.
Step3: In the opening Task Scheduler dialog box, right-click Task Scheduler Library – > select Create Task.
Step4: In the popping up "Create Task" window, in the "General" tab, fill in the name, description, and security options.
step5: In the "Trigger" tab, click "New", and in the pop-up "New Trigger" window, set the execution time - "OK".
step6: In the "Actions" tab, click "New", in the pop-up "New Action" window, under the settings "Program or Script" select the .exe file we just generated in VS - "OK".
step7: In the "Conditions" tab, remove some tick options.
Step8: In the "Settings" tab, make the relevant settings - > confirm.
Okay, so we have a simple timed email function.
Epilogue
It's just that the demo is very rough. Send emails, and you can also set CC by, attachments, etc. The next topic will continue to record scheduled execution tasks.
|