MailAttachment コンストラクタとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > MailAttachment コンストラクタの意味・解説 

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 名前空間



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

辞書ショートカット

すべての辞書の索引

「MailAttachment コンストラクタ」の関連用語

MailAttachment コンストラクタのお隣キーワード
検索ランキング

   

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



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

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

©2025 GRAS Group, Inc.RSS