المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : attachment encoding base64



C# Programming
04-02-2009, 08:50 AM
System.Net.Mail.MailMessage mm = new System.Net.Mail.MailMessage();
//string attach .attachment file name
System.Web.Mail.MailAttachment attached = new System.Web.Mail.MailAttachment(attach,System.Web.Mail.MailEncoding.Base64);
mm.Attachments.Add(attached);
problem is that attachments.add method do not accept object of MailAttachment.
..............................
if i use
System.Net.Mail.Attachment attached = new Attachment(attach);
mm.Attachments.Add(attached);
this works fine
/////////////////////////////////
I want to convert attachment to base64 encoding then how will i do if i use
System.Net.Mail.Attachment