This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| userspace:lib.sendmail [2014/01/10 10:30] embl-structures created | — (current) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Library: SendMail ====== | ||
| - | |||
| - | |||
| - | Tested with opsi 4.0.2\\ | ||
| - | required WInst Version: // | ||
| - | By //Frank Thommen, 2014/01/10 11:13// | ||
| - | |||
| - | This script requires blat which can be downloaded from http:// | ||
| - | |||
| - | |||
| - | === sendmail.sub === | ||
| - | <code winst> | ||
| - | if ($_mail.msgtype = " | ||
| - | WinBatch_SendMailFromFile | ||
| - | else | ||
| - | if ($_mail.msgtype = " | ||
| - | ; avoid error message in case this function is used more then once | ||
| - | ; within script | ||
| - | ScriptErrorMessages = off | ||
| - | DefVar $__mail.msgfile | ||
| - | ScriptErrorMessages = on | ||
| - | |||
| - | ; Create temporary filename and encode to get rid of | ||
| - | ; special characters which might not be allowed in filenames | ||
| - | Set    $__mail.msgfile = " | ||
| - | |||
| - | ; and also get rid of " | ||
| - | Set    $__mail.msgfile = stringReplace($__mail.msgfile, | ||
| - | if ( FileExists($__mail.msgfile) ) | ||
| - | PAUSE " | ||
| - | else | ||
| - | for %s% in $_mail.msgstrlist do DosInAnIcon_DumpToFile | ||
| - | if NOT( FileExists($__mail.msgfile) ) | ||
| - | PAUSE " | ||
| - | else | ||
| - | WinBatch_SendMailFromLocalFile | ||
| - | Files_DeleteMsgFile | ||
| - | endif | ||
| - | endif | ||
| - | else | ||
| - | if ($_mail.msgtype = " | ||
| - | WinBatch_SendMailFromString | ||
| - | else | ||
| - | PAUSE " | ||
| - | endif | ||
| - | endif | ||
| - | endif | ||
| - | |||
| - | |||
| - | ; | ||
| - | ; ---------------------------------------------------------- | ||
| - | ; | ||
| - | |||
| - | [DosInAnIcon_DumpToFile] | ||
| - | echo %s% >> $__mail.msgfile | ||
| - | |||
| - | [Files_DeleteMsgFile] | ||
| - | del -f " | ||
| - | |||
| - | |||
| - | [WinBatch_SendMailFromFile] | ||
| - | " | ||
| - | |||
| - | |||
| - | [WinBatch_SendMailFromString] | ||
| - | " | ||
| - | |||
| - | |||
| - | [WinBatch_SendMailFromLocalFile] | ||
| - | " | ||
| - | |||
| - | </ | ||
| - | |||