Tips

[4D write] 4D Write書類からテキストを抽出し、電子メールbodyに貼る方法

日付2002/02/08
ID01-834
バージョン6.5.x and 6.7.x
プラットフォームWindows and Mac OS

この記事は、最新ではないバージョンに関連した方法について解説しています。

最新のバージョンでは推奨されていないか、または他の方法で簡単に実現できる可能性があります。

4D Writeがそれ自身のフォーマットにテキストを格納するので、あなたの電子メールのbodyへそれをはる前にドキュメントからの純粋なテキストを抽出しなければなりません。4D Writeドキュメントからの抜粋テキストより下の例はピクチャーフィールドに格納し、電子メールのbodyへそれをはります。

ALL RECORDS([Table 1]) `Selecting all Records
For(i;1;Records in selection([table 1])) `Loop through all records
Temp:=WR New offscreen area `Creating an offscreen area
WR PICTURE TO AREA (Temp;[Table 1]Doc_) `Placing template in offscreen area
vText:=WR Get text (Temp;0;25) `Grabbing the first 25 characters in the area Temp
WR DELETE OFFSCREEN AREA (Temp) `Deleting the offscreen area

$error:=SMTP_New ($smtp_id)
$error:=SMTP_Host ($smtp_id;"mymailhost.com")
$error:=SMTP_From ($smtp_id;"someone@somewhere.com")
$error:=SMTP_Subject ($smtp_id;"Discounts on Ad Space!")
$error:=SMTP_To ($smtp_id;"someone@outthere.com";1) `Replace the "To" header with new value
$error:=SMTP_Body ($smtp_id;vText) `Placing the text into the body
$error:=SMTP_Send ($smtp_id)
Next Record([Table 1])
End for