How to send email automatically using windows application?

In this article i have explained about how to send email automatically using windows application and windows scheduler. The Windows scheduler automatically executes your .exe file and sends mail to customer without any manual operation. Once we mention day & time then automatically email send every mention time until you stop that scheduler operation.

Automatic email sending process is easy to using windows scheduler and use of .exe file for send email automatically. For example every day you like send email automatically for tell Good Morning! message to your friend then refer below process.

Select File->New Project->windows form application in Visual Studio.

Form Design:

No control is used in the form design

Server side:
Double click on the form form_load event is occurred you can write where ever you want process execution code. I created mail code for send automatically mail send.

using System.Net;
using System.Net.Mail;
private void Form1_Load(object sender, EventArgs e)
MailMessage msg = new MailMessage("", "", "subjectofmail", "Mail_Body like Good Morning etc.");
SmtpClient mailClient = new SmtpClient("", 587);
NetworkCredential NetCrd = new NetworkCredential("", "fromidpassword");
mailClient.UseDefaultCredentials = false;
mailClient.Credentials = NetCrd;
mailClient.EnableSsl = true;
mailClient.DeliveryMethod = SmtpDeliveryMethod.Network;
catch (Exception ex)

How to create .exe file for my windows application?
You no need to create any .exe file after write code just build application and run application, test the application for whether you got mail or not. Then automatically .exe file is created in the source location bin->Debug folder.

How to add .exe file into windows Scheduler?
Select Control panel->Scheduled Tasks->Double click of add scheduled task

New small window is opened click next browse your .exe location (.exe in your project location bin->Debug) and add it further next click allot schedule time and which day that .exe execute (daily/monthly/weekly etc). After select all options click finish. Then whenever your scheduled time are come that .exe file run automatically and send mail to customer.

We learn in this article how to send email using windows scheduler at the specified mention time. I hope this article is help to you.


No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: