File:  [parser3project] / parser3 / tests / 235.html
Revision 1.4: download - revision graph
Tue Jun 30 23:08:35 2020 UTC (5 years, 11 months ago) by moko
Branches: MAIN
CVS tags: release_3_5_1, release_3_5_0, release_3_4_6, HEAD
test result updated as messages before attachments implemented (feature #1176)

@main[]
$sBody[Тело письма]
$sAttachFileName[235_attach.txt]

$fText[^file::load[text;$sAttachFileName]]
$fBinary[^file::load[binary;$sAttachFileName]]

1 ^do[;
	$.text[$sBody]
	$.x-mailer[Parser 3]
]

2 ^do[windows-1251;
	$.text[$sBody]
	$.html{<p>$sBody</p>}
]

3 ^do[windows-1251;
	$.text[$sBody]
	$.file[$fText]
	$.file2[$fBinary]
]

4 ^do[windows-1251;
	$.text[$sBody]
	$.file[$fBinary]
	$.message[
		$.from[from-message@parser3test]
		$.to[to-message@parser3test]
		$.charset[windows-1251]
		$.subject[Заголовок вложения]
		$.text[Тело вложения]
		$.file[$fText]
	]
]

5 ^do[windows-1251;
	$.text[$sBody]
	$.file[
		$.value[$fText]
		$.content-id[C-ID]
		$.format[uue]
	]
]

@postprocess[text]
^1251[]
# replace boundary by fixed string
$result[^text.match[(-{10,})[0-9a-fA-F]+(--)?][g]{${match.1}boundary-value$match.2}]

@do[sCharset;hData]
<pre>
^mail:send[
	^hash::create[$hData]
	$.from[from@parser3test]
	$.to[to@parser3test]
	^if(def $sCharset){
		$.charset[$sCharset]
	}
	$.subject[Заголовок]
	$.print-debug(1)
]
</pre>
<hr />

E-mail: