Must use in this way guys,I used this and worked!
SmtpClient client = new SmtpClient("mail.somecompany.com", 25);
client.Credentials =
new NetworkCredential("user@somecompany.com", "password");
using (MailMessage msg = new MailMessage())
{
msg.From = new MailAddress("me@me.com");
msg.Subject = "hi";
msg.Body = "Hi.";
msg.Attachments.Add(
new Attachment(@"..\..\Recipe10-07.cs","text/plain"));
msg.Attachments.Add(
new Attachment(@".\Recipe10-07.exe",
"application/octet-stream"));
}
client.Send(msg);