I can't send email with attachment of type .txt and .html file

Jan 30, 2015 at 10:17 AM
I am trying to send attachment files of type .txt and .html as extensions but the mail is not getting sent it gives error. for this i am giving you my code of sending the mail with attachment of type .txt
        SmtpClient objSmtpClient = new SmtpClient();
        SmtpContent objSmtpContent = new SmtpContent();
        SmtpMessage objSmtpMessage = new SmtpMessage();
        objSmtpClient.ServerName = "xxx";
        objSmtpClient.Port = 25;
        objSmtpClient.UserName = "";
        objSmtpClient.Password = "";
        objSmtpMessage.From = new MailAddress("xxx@xyz.com");
        objSmtpContent.LoadFileData(@"D:\\helllo.txt");
        objSmtpMessage.Contents.Add(objSmtpContent);
        objSmtpMessage.To.Add(new MailAddress("ccc@xyz.com"));
        objSmtpMessage.Subject = "hello this is try";
        objSmtpMessage.SetBodyAsHtmlContent("<br>hello<br>");
        objSmtpClient.SendMail(objSmtpMessage);
Feb 4, 2015 at 11:21 AM
Hey guys if anyone has a solution over the post that I have sent please do the needfull, I need it very urgently .
Jul 19, 2015 at 2:29 AM
If you are trying to send email in C#, you can refer here:
http://www.codeproject.com/Tips/520998/Send-Email-from-Yahoo-GMail-Hotmail-Csharp

or ask your question at StackOverFlow

Dude, You have posted your question at wrong place.
This place is for discussion of service of CodePlex.
Codeplex is an Open source project hosting site.
I believe you are asking something related to specific project which is hosted in CodePlex.
You won't find any answer here.
Try look for your project at [Search] at top right side of this page.