Hi to Everybody,
I have use the C#.net for send the E-mail as follows
MailMessage omsg = new MailMessage();
omsg.From = new MailAddress("sathiy.03@gmail.com");
omsg.To.Add(new MailAddress(txtEmail.Text));
//omsg.Subject = txtSubject.Text;
//omsg.Body = txtContent.Text;
if (txtSubject.Text.Trim() != "")
{
omsg.Subject = txtSubject.Text.Trim();
}
else
{
omsg.Subject = "No Subject";
}
//omsg.IsBodyHtml = true;
omsg.Body = txtContent.Text.Trim();
omsg.Attachments.Add(new Attachment("d://download.txt"));
SmtpClient client = new SmtpClient("192.168.1.5", 25);
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Credentials = System.Net.CredentialCache.DefaultNetworkCredentia ls;
//client.Host = ;
try
{
client.Send(omsg);
}
catch (SmtpFailedRecipientsException ex)
{
for (int i = 0; i < ex.InnerExceptions.Length; i++)
{
Response.Write(ex.InnerExceptions[i].FailedRecipient.ToString());
}
}
If i send the mail with attach file it did not receive but it received without attachment file.
Please give me the solution to send e-mail with attached file.
Thanks