Construct and Send an ICS file as an attachment in the Email


Here I will explain it in detail, how we can construct the ICS file and send as an attachment in the email. 

First create a method

public void SendmailWithIcsAttachment()
{
    1.gif      
    //Now we have to set the value to Mail message properties. As shown below.
    2.gif
    //Note Please change it to correct mail-id to use this in your application
    msg.From = new MailAddress("[email protected]", "ABC");
    msg.To.Add(new MailAddress("[email protected]", "BCD"));
    msg.CC.Add(new MailAddress("[email protected]", "DEF"));// it is optional, only if required
    msg.Subject = "Send mail with ICS file as an Attachment";
    msg.Body = "Please Attend the meeting with this schedule";
    msg.Subject = "Send mail with ICS file as an Attachment";
    msg.Body = "Please Attend the meeting with this schedule";  
        
    3.gif       

Now will see the Sending mail part

4.gif 

}

Happy Coding!!!

Up Next
    Ebook Download
    View all
    Learn
    View all