4D v15SMTP_Attachment |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
4D v15
SMTP_Attachment
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
SMTP_Attachment ( smtp_ID ; fileName ; encodeType ; deleteOption {; attachmentID {; contentType}} ) -> 戻り値
|
||||||||||||||||||||||||||||||||||
4D v14 R4 から導入
テーマ: ICメール送信
SMTP_Attachment コマンドは、新しいcontentType 引数を受け取るようになり、これによって添付ファイルのコンテンツタイプを設定することが出来るようになりました。
デフォルトでは、contentType parameter 引数が省略されている、または空の文字列を含む場合、4DICは自動的に添付ファイルのコンテンツタイプを、その拡張子に応じて設定します。その際、以下のルールが適用されます:
| 拡張子 | コンテンツタイプ |
| jpg, jpeg | image/jpeg |
| png | image/png |
| gif | image/gif |
| application/pdf | |
| doc | application/msword |
| xls | application/vnd.ms-excel |
| ppt | application/vnd.ms-powerpoint |
| zip | application/zip |
| gz | application/gzip |
| json | application/json |
| js | application/javascript |
| ps | application/postscript |
| xml | アプリapplication/xml |
| htm, html | text/html |
| mp3 | audio/mpeg |
| other | application/octet-stream |
contentType には、ファイルのコンテンツタイプ(MIMEタイプ)を定義する文字列を渡す事ができます(例えば、"video/mpeg"などです)。このコンテンツタイプの値は添付ファイルの拡張子に関係なくその添付ファイルに適用されます。
注: この引数を使用しない場合、attachmentID に空の文字列("")を渡して下さい。
設定ファイルをXMLファイルとして宣言したい場合を考えます:
$path:=Get 4D folder(Database folder)+"Settings.mySettings"
$err:=SMTP_Attachment($smtp_id;$path;2;0;"myID123";"application/xml")
プロダクト: 4D
テーマ: 4D Internet Commands
4D v15 - アップグレードリファレンス(標準版) ( 4D v15)
コメントを追加