blob: b0f5dfcc3a7a1920e1762c907a90612106655005 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
//
// System.Web.Mail.MailAttachment.cs
//
// Author:
// Lawrence Pit (loz@cable.a2000.nl)
//
namespace System.Web.Mail
{
public class MailAttachment
{
private string filename;
private MailEncoding encoding;
public MailAttachment (string filename) :
this (filename, MailEncoding.Base64)
{
}
public MailAttachment (string filename, MailEncoding encoding)
{
this.filename = filename;
this.encoding = encoding;
try {
System.IO.File.OpenRead (filename).Close ();
} catch (Exception) {
throw new System.Web.HttpException ("Cannot find file: " + filename);
}
}
// Properties
public string Filename
{
get { return filename; }
}
public MailEncoding Encoding
{
get { return encoding; }
}
}
} //namespace System.Web.Mail
|