You can use background thread
Thread threadSendMails;
threadSendMails = new Thread(delegate()
{
sendemail("username@gmail.com", "receiver@abc.com", "Hello", "<p>Body</p>", "C:\\MyDoc.txt", true);
});
threadSendMails.IsBackground = true;
threadSendMails.Start();
Reference: http://www.aspsnippets.com/Articles/Send-SMTP-Emails-using-System.Net-Class-in-C.aspx