MailAttachmentとは? わかりやすく解説

MailAttachment クラス

メモ : このクラスは、互換性のために残されています。

電子メール添付ファイル作成するために使用するプロパティメソッド提供します推奨する代替 : System.Net.Mail

名前空間: System.Web.Mail
アセンブリ: System.Web (system.web.dll 内)
構文構文

<ObsoleteAttribute("The recommended alternative is System.Net.Mail.Attachment.
 http://go.microsoft.com/fwlink/?linkid=14202")> _
Public Class MailAttachment
Dim instance As MailAttachment
[ObsoleteAttribute("The recommended alternative is System.Net.Mail.Attachment.
 http://go.microsoft.com/fwlink/?linkid=14202")] 
public class MailAttachment
[ObsoleteAttribute(L"The recommended alternative is System.Net.Mail.Attachment.
 http://go.microsoft.com/fwlink/?linkid=14202")] 
public ref class MailAttachment
/** @attribute ObsoleteAttribute("The recommended alternative is System.Net.Mail.Attachment.
 http://go.microsoft.com/fwlink/?linkid=14202") */ 
public class MailAttachment
ObsoleteAttribute("The recommended alternative is System.Net.Mail.Attachment.
 http://go.microsoft.com/fwlink/?linkid=14202") 
public class MailAttachment
継承階層継承階層
System.Object
  System.Web.Mail.MailAttachment
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
MailAttachment メンバ
System.Web.Mail 名前空間

MailAttachment コンストラクタ (String)

添付ファイルの名前を指定して、MailAttachment クラス新しインスタンス初期化します。既定では、Encoding プロパティUUEncode設定されます。推奨する代替 : System.Net.Mail.

名前空間: System.Web.Mail
アセンブリ: System.Web (system.web.dll 内)
構文構文

解説解説
使用例使用例
'This example shows how to programmatically add attachments 
'to a mail lessage.

Dim MyMail As MailMessage = New
 MailMessage()
Dim iLoop1 As integer
  
' Concatenate a list of attachment files in a string.
Dim sAttach As String =
 "C:\images\image1.jpg,C:\images\image2.jpg,C:\images\image3.jpg"
 
' Build an IList of mail attachments using the files named in the string.
Dim delim As Char = "
,"
Dim sSubstr As String
For Each sSubstr in sAttach.Split(delim)
   Dim myAttachment As MailAttachment = New
 MailAttachment(sSubstr)
   myMail.Attachments.Add(myAttachment)
Next
//This example shows how to programmatically add attached files 
//to a mail lessage.

MailMessage myMail = new MailMessage();

// Concatenate a list of attachment files in a string.
string sAttach = @"C:\images\image1.jpg,C:\images\image2.jpg
,C:\images\image3.jpg";

// Build an IList of mail attachments using the files named in the string.
char[] delim = new char[]
 {','};
foreach (string sSubstr in
 sAttach.Split(delim))
{
   MailAttachment myAttachment = new MailAttachment(sSubstr);
   myMail.Attachments.Add(myAttachment);
}
//This example shows how to programmatically add attached files 
//to a mail lessage.
MailMessage myMail = new MailMessage();

// Concatenate a list of attachment files in a string.
String sAttach = "C:\\images\\image1.jpg,C:\\images\\image2.jpg," 
    + "C:\\images\\image3.jpg";

// Build an IList of mail attachments using the files named
// in the string.
char delim[] = new char[]
 { ',' };

for (int iCtr = 0; iCtr < sAttach.Split(delim).get_Length();
 iCtr++) {
    String sSubstr = sAttach.Split(delim)[iCtr];
    MailAttachment myAttachment = new MailAttachment(sSubstr);
    myMail.get_Attachments().Add(myAttachment);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
MailAttachment クラス
MailAttachment メンバ
System.Web.Mail 名前空間

MailAttachment コンストラクタ

MailAttachment クラス新しインスタンス初期化します。推奨する代替 : System.Net.Mail
オーバーロードの一覧オーバーロードの一覧

参照参照

関連項目

MailAttachment クラス
MailAttachment メンバ
System.Web.Mail 名前空間

MailAttachment コンストラクタ (String, MailEncoding)

添付ファイルの名前とエンコーディング種類指定して、MailAttachment クラス新しインスタンス初期化します。推奨する代替 : System.Net.Mail

名前空間: System.Web.Mail
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Sub New ( _
    filename As String, _
    encoding As MailEncoding _
)
public MailAttachment (
    string filename,
    MailEncoding encoding
)
public:
MailAttachment (
    String^ filename, 
    MailEncoding encoding
)
public MailAttachment (
    String filename, 
    MailEncoding encoding
)
public function MailAttachment (
    filename : String, 
    encoding : MailEncoding
)

パラメータ

filename

添付ファイルの名前。

encoding

添付ファイルの MailEncoding の種類

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
MailAttachment クラス
MailAttachment メンバ
System.Web.Mail 名前空間

MailAttachment プロパティ


MailAttachment メソッド


MailAttachment メンバ

電子メール添付ファイル作成するために使用するプロパティメソッド提供します推奨する代替 : System.Net.Mail

MailAttachment データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド MailAttachment オーバーロードされます。 MailAttachment クラス新しインスタンス初期化します。推奨する代替 : System.Net.Mail
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

MailAttachment クラス
System.Web.Mail 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「MailAttachment」の関連用語

MailAttachmentのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



MailAttachmentのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS