<<Back To Faq 4.3.7


Complete FAQ Listing


4.3.7 The specified protocol is unknown. Part 2 Printer Friendly   Email This FAQ   Discuss

If you are getting this error, and you are adding attachments, you might be adding them incorrectly. You can only create a MailAttachment by specifying an absolute path.

For example, if you are doing something like:

MailAttachment a = new MailAttachment( "test.txt" );
m.Attachments.Add( a );

You will instead, need to explicitly specify the path. So try

MailAttachment a = new MailAttachment( Server.MapPath( "test.txt" ) ); //if this is an ASP.NET app
m.Attachments.Add( a );

or, from a console/winform app try

MailAttachment a = new MailAttachment( "c:\\test.txt" );
m.Attachments.Add( a );
 



The formatted version of this faq can be found at http://www.SystemWebMail.com/faq/4.3.7.aspx