0

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

2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by alamimranster
0
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());      


        }


    }

Edited by Nick Evan: Fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.