Hi Everone!!

I want to send Automated Emails every quarter to remind the user of specific task.
I want to write in ASP.Net without using Windows Services.
Can anyone help me regarding this.
Please provide Sample code for this Automated Emails.

Regards,
Pavan Kumar

public static void sendMessage(string sendTo, string sendFrom, string sendSubject, string sendMessage)
    {

        try
        {

            MailMessage message = new MailMessage(sendFrom, sendTo, sendSubject, sendMessage);                

            Attachment attachFile = new Attachment("Location of File Name");

            message.Attachments.Add(attachFile);

            message.Body = "<html><body><Table><tr><td>Hi,</td></tr><tr><td>Details of the Statistics :</td></tr></Table></body></html><html><body>";

            string MySmtpMailServerName = "xyz.net";

            int MySmtpMailServerPort = ##;

            SmtpClient client = new SmtpClient(MySmtpMailServerName, MySmtpMailServerPort);

            client.UseDefaultCredentials = true;

            client.Send(message);


        }

        catch (Exception ex)
        {

          MessageBox.Show(ex.Message.ToString());      


        }


    }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.