DotNetOpenMail 0.5.7 (beta)

FileAttachment Constructor

Create a new File attachment from a FileInfo object

Overload List

Create a new binary file attachment from an array of bytes.

[Visual Basic] Public Sub New(ByVal Byte())
[C#] public FileAttachment(byte[]);
[C++] public: FileAttachment(char __gc[]);
[JScript] public function FileAttachment(Byte[]);

Create a new file attachment from a byte array. The contentid will be used to refer to this attachment in another mime part of the email.

[Visual Basic] Public Sub New(ByVal Byte(),ByVal String)
[C#] public FileAttachment(byte[],string);
[C++] public: FileAttachment(char __gc[],String*);
[JScript] public function FileAttachment(Byte[],String);

Create a new File attachment from a FileInfo object

[Visual Basic] Public Sub New(ByVal FileInfo)
[C#] public FileAttachment(FileInfo);
[C++] public: FileAttachment(FileInfo*);
[JScript] public function FileAttachment(FileInfo);

Create a new File attachment with a contentid from a FileInfo object. The contentid will be used to refer to this attachment in another mime part of the email.

[Visual Basic] Public Sub New(ByVal FileInfo,ByVal String)
[C#] public FileAttachment(FileInfo,string);
[C++] public: FileAttachment(FileInfo*,String*);
[JScript] public function FileAttachment(FileInfo,String);

Create a new text file attachment from a StreamReader.

[Visual Basic] Public Sub New(ByVal StreamReader)
[C#] public FileAttachment(StreamReader);
[C++] public: FileAttachment(StreamReader*);
[JScript] public function FileAttachment(StreamReader);

Create a new file attachment from a StreamReader. The contentid will be used to refer to this attachment in another mime part of the email.

[Visual Basic] Public Sub New(ByVal StreamReader,ByVal String)
[C#] public FileAttachment(StreamReader,string);
[C++] public: FileAttachment(StreamReader*,String*);
[JScript] public function FileAttachment(StreamReader,String);

Create a new file attachment from a String.

[Visual Basic] Public Sub New(ByVal String)
[C#] public FileAttachment(string);
[C++] public: FileAttachment(String*);
[JScript] public function FileAttachment(String);

Create a new text file attachment from a String. The contentid will be used to refer to this attachment in another mime part of the email.

[Visual Basic] Public Sub New(ByVal String,ByVal String)
[C#] public FileAttachment(string,string);
[C++] public: FileAttachment(String*,String*);
[JScript] public function FileAttachment(String,String);

See Also

FileAttachment Class | DotNetOpenMail Namespace