Html で作成されたフォームと、特定のアドレスへの電子メールのピックアップ フォルダーにファイルを書き込む VBScript があります。書き込みスクリプトの現在のフィールドを、フォーム データを変数として置換または追加したいと考えています。これを実装するには、どの VBscript を使用しますか? また、送信ボタンによってスクリプトが呼び出されるようにしたいのですが、どうすればよいですか?
ここに私のフォームHTMLがあります:
<!doctype=html>
<html>
</div>
<body onload="window.resizeTo(750,800)">
<div align="left">
<font face="calibri" size="4">
<p><b>Thank you!!</b> …For taking the time to offer your subjects to the senior management via this Stakeholder forum. Please fill out the required information on the front sheet below. Use as many additional sheets as necessary.</p>
<form>
<p>
<fieldset>
<font color="0000FF">1)</font > Date of your submission <font color="grey" size="3">(__/__/20__)</font>:<br> <input type="date" STYLE= "background-color: #FFFF00" name="__/__/20__"><br>
</fieldset>
</p>
<p>
<fieldset>
<font color="0000FF">2)</font> Give Your submission a name: <font color="grey" size="3"> (This can be any inoffensive word or phrase at all… even if it doesn’t relate to the nature of the subject) </font><br>
<input type="text" STYLE= "background-color: #FFFF00" name="Submission Name">
</fieldset>
</p>
<p>
<fieldset>
<font color="0000FF">3)</font> This Submission includes:<br>
<select>
<option value="Select..."STYLE= "background-color: #FFFF00">Select...</option>
<option value="Polite and detailed rant (no proposed solution(s) )" STYLE= "background-color: #FFFF00">Polite and detailed rant (no proposed solution(s) )</option>
<option value="Problem(s) / area(s) for improvement with proposed solution(s)" STYLE= "background-color: #FFFF00">Problem(s) / area(s) for improvement with proposed solution(s)</option>
<option value="New Idea(s) / Resurrected old idea(s)" STYLE= "background-color: #FFFF00">New Idea(s) / Resurrected old idea(s)</option>
<option value="Abstract / Other" STYLE= "background-color: #FFFF00">Abstract / Other</option>
</select>
</fieldset>
</p>
<p>
<fieldset>
<font color="0000FF">4)</font> Indicate which areas of our business this submission is connected with… <font color="grey" size="3"> (delete as applicable) </font><br>
<select>
<option value="Select..."STYLE= "background-color: #FFFF00">Select...</option>
<option value="Customer / Supplier Aspects"STYLE= "background-color: #FFFF00">Customer / Supplier Aspects</option>
<option value="Financial Performance" STYLE= "background-color: #FFFF00">Financial Performance</option>
<option value="Innovation and growth" STYLE= "background-color: #FFFF00">Innovation and growth</option>
<option value="Internal Business/Systems" STYLE= "background-color: #FFFF00">Internal Business/Systems</option>
</select>
</fieldset>
</p>
<p>
<fieldset>
<font color="0000FF">5)</font> Personal Details:<font color="grey" size="3"> (optional) </font><br>
First name: <input type="text" STYLE= "background-color: #FFFF00" name="firstname"><br>
Last name: <input type="text" STYLE= "background-color: #FFFF00" name="lastname"><br>
Contact Number: <input type="text" STYLE= "background-color: #FFFF00" name="contactnumber">
</fieldset>
</p>
<p>
<fieldset>
<font color="#0000ff">6)</font> The details of your submission… remembering to avoid:<br>
<ul>
<li>Cases that are associated with just one single individual. These type of subjects are best dealt with outside of this forum</li>
<li>Vulgarities and or insults.</li>
</ul>
<textarea rows="10" cols="50" col width= "100" STYLE= "background-color: #FFFF00">Dear senior management...
</textarea>
ファイルに書き込むためのVBscriptは次のとおりです。
Set objFSO=CreateObject("Scripting.FileSystemObject")
' How to write file
outFile="\\location\file.txt"
Set objFile = objFSO.CreateTextFile(outFile,True)
objFile.Write "to:email1@mail.com" & vbCrLf
objFile.Write "from:email2@mail.com" & vbCrLf
objFile.Write "subject:This is a test." & vbCrLf
objFile.Write ("") & vbCrLf
objFile.Write "This is the body of the email." & vbCrLf
objFile.Close