corrupted email attachments

  • Thread starter Alejandro Penate-Diaz
  • Start date
A

Alejandro Penate-Diaz

hi. I am sending attachments and for some reason the files are getting
corrupted and a different size than the original file. I am sending word and
excel documents.
below is the code I am using


MailMessage Message = new MailMessage();



MailAttachment att = new
MailAttachment(Server.MapPath(".")+ \\sample.doc);



Message.To = (e-mail address removed);



Message.From = (e-mail address removed);

Message.Subject = "Mail from asp.net";

Message.Attachments.Add(att);



try

{

SmtpMail.SmtpServer = "my.mailserver.com";

SmtpMail.Send(Message);

}

catch(System.Web.HttpException ehttp)

{

this.Response.Write(ehttp.ToString());

}



any help is very welcome.

Tnx,

Alejandro.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

ASP.NET email - messages ending upin the '\Inetpub\mailroot\Queue' 0
Mail Send Problem 4
Help with email form and mulitple attachments 7
Attachments 1
SMTP Mail 0
SMTPMAIL 3
CDOSYS problems 0
email attachments 2

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,735
Latest member
HikmatRamazanov

Latest Threads

Top