126 lines
3.2 KiB
HTML
126 lines
3.2 KiB
HTML
<head>
|
|
<!--
|
|
<OBJECT id=obj CLASSID="clsid:5E7C299F-6EAD-4F6D-AFC0-B6972931517D"></Object>
|
|
<OBJECT id=ip CLASSID="clsid:BFB3EC07-A552-4F57-9CC5-06B02205C566"></Object>
|
|
-->
|
|
</head>
|
|
<body>
|
|
<input type=button value="Logon" OnClick="DoLogon()"><br>
|
|
<input type=button value="OpenAddressBox" OnClick="DoAddressBook()"><br>
|
|
<input type=text id="idSubject">
|
|
<input type=button value="CheckSubject" OnClick="DoSubject()"><br>
|
|
<input type=text id="idBody">
|
|
<input type=button value="CheckBody" OnClick="DoBody()"><hr>
|
|
<input type=button value="GetIPAddress" OnClick="GetIP()"><hr>
|
|
<input type=button value="GetUserTempFileName" OnClick="GetTempFile()"><hr>
|
|
<input type=text id="idSet"><input type=button value="Set" OnClick="DoSet()"><hr>
|
|
<input type=text id="idGet"><input type=button value="Get" OnClick="DoGet()"><hr>
|
|
Now testing SendMail functions:<br>
|
|
We use the hardcoded c:\test.htm as attachment.
|
|
<input type=text id="idTo"> <input type=button value="Send Mail" OnClick="DoSend()">
|
|
</body>
|
|
<script language=VBScript>
|
|
Function DoSend()
|
|
On Error Resume Next
|
|
set obj = CreateObject("RcBdyCtl.smapi")
|
|
obj.Logon
|
|
obj.AddRecipient idTo.value
|
|
obj.AttachedXMLFile = "c:\test.htm"
|
|
obj.SendMail
|
|
obj.Logoff
|
|
if (Err.Number <>0) Then
|
|
MsgBox Err.Description
|
|
End If
|
|
set obj = Nothing
|
|
End Function
|
|
|
|
Function DoBody()
|
|
On Error Resume Next
|
|
set obj = CreateObject("RcBdyCtl.smapi")
|
|
obj.Logon
|
|
obj.Body = idBody.value
|
|
MsgBox "If You can see what you typed in here: " & obj.Body & chr(13) & "Then it's correct"
|
|
obj.Logoff
|
|
if (Err.Number <>0) Then
|
|
MsgBox Err.Description
|
|
End If
|
|
set obj = Nothing
|
|
End Function
|
|
|
|
Function DoSubject()
|
|
On Error Resume Next
|
|
set obj = CreateObject("RcBdyCtl.smapi")
|
|
obj.Logon
|
|
obj.Subject = idSubject.value
|
|
MsgBox "If You can see what you typed in here: " & obj.Subject & chr(13) & "Then it's correct"
|
|
obj.Logoff
|
|
if (Err.Number <>0) Then
|
|
MsgBox Err.Description
|
|
End If
|
|
set obj = Nothing
|
|
End Function
|
|
|
|
Function DoLogon()
|
|
On Error Resume Next
|
|
set obj = CreateObject("RcBdyCtl.smapi")
|
|
if (Err.Number <>0) Then
|
|
MsgBox Err.Description
|
|
End If
|
|
obj.Logon
|
|
set obj = Nothing
|
|
End Function
|
|
|
|
Function DoAddressBook()
|
|
On Error Resume Next
|
|
set obj = CreateObject("RcBdyCtl.smapi")
|
|
obj.Logon
|
|
obj.OpenAddressBox
|
|
if (Err.Number <>0) Then
|
|
MsgBox Err.Description
|
|
End If
|
|
'obj.Logoff
|
|
'set obj = Nothing
|
|
End Function
|
|
|
|
Function GetIP()
|
|
On Error Resume Next
|
|
set obj = CreateObject("RcBdyCtl.Setting")
|
|
sIP = obj.GetIPAddress
|
|
if (Err.Number <>0) Then
|
|
MsgBox Err.Description
|
|
else
|
|
MsgBox "IPAddress: " & sIP
|
|
End If
|
|
set obj = Nothing
|
|
End Function
|
|
</Script>
|
|
<Script>
|
|
function GetTempFile()
|
|
{
|
|
try {
|
|
var obj = new ActiveXObject("RcBdyCtl.Setting");
|
|
var sFile = obj.GetUserTempFileName;
|
|
alert(sFile);
|
|
} catch (e) {
|
|
alert("Error: " & e.Description);
|
|
}
|
|
}
|
|
|
|
function DoSet()
|
|
{
|
|
var val = idSet.value;
|
|
try {
|
|
var obj = new ActiveXObject("RcBdyCtl.Setting");
|
|
obj.SetProfileString("RCBDY", val);
|
|
var sRet = obj.GetProfileString("RCBDY");
|
|
alert("Get from Ini: " + sRet);
|
|
} catch (e) {
|
|
alert("Error: " + e.Description);
|
|
}
|
|
}
|
|
|
|
function DoGet()
|
|
{
|
|
}
|
|
</Script>
|