Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Send Email with dialog.


Keywords: Send Email with HTML dialog text field edit box lines

Question:

I am trying to create a dialog that can emulate an email type dialog. Is it possible to add a multiple line editbox to a Dialog using the WIL dialog editor?

Answer:

Sorry no, the WIL dialog editor can only accept single line edit boxes, up to somewhere around approximately 80 characters long. However, You can use the HTML Dialog Editor for multiple line text input.

First, create the dialog using HTML. Save the following code as "email.html"


<html>
<body>
<html>
<head>
<title>email</title>
</head>
<body>
<form name="form1"  method="post" >
 

<BR><TABLE cellspacing=0 cellpadding=8 bgcolor="blue">
 

<TR><TD align=left>
Mailserver: <INPUT type="text" name="Mailserver" size=45><BR>
</TD></TR>
<TR><TD align=left>
UserName:   <INPUT type="text" size=45 name="UserName"><BR>
</TD></TR>
<TR><TD align=left>
Password:   <INPUT type="password" size=45 name="Password"><BR>
</TD></TR>
<TR><TD align=left>
Email From: <INPUT type="text" name="sender" size=45><BR>
</TD></TR>
<TR><TD align=left>
Email to:   <INPUT type="text" size=45 name="emailto"><BR>
</TD></TR>
<TR><TD align=left>
Subject:    <INPUT type="text" size=45 name="subject"><BR>
</TD></TR>
<TR><TD align=left>
 
 

<TR><TD align=center>Text Message:<BR>
<TEXTAREA wrap=virtual rows=5 cols=50 name="emailtext"></TEXTAREA></TD></TR>

</TABLE><BR>

<INPUT type="submit" name="submit" value="Send">
</FORM>
</CENTER>
</BODY>
</HTML>

Then, create the winbatch script using HTML Dialog extender and the Postie extender.
Save the following code as "email.WBT"

AddExtender("WWHTM34I.DLL")

path=FileLocate("c:\windows\desktop\email.html")

WinTitle("","Emailer")
hBrowseSetPos(200,100,800,900)
hBrowse(2,path,2)
mailhost=hGetVarValue("Mailserver"," ")
Userid=hGetVarValue("Username"," ")
password=hGetVarValue("password"," ")
sender=hGetVarValue("sender"," ")
tolist=hGetVarValue("emailto"," ")
subject=hGetVarValue("subject"," ")
body=hGetVarValue("emailtext"," ")

hBrowse(0,path,0)

;USED FOR DEBUGGING
;Message("Your Mailserver", mailhost)
;Message("Your username", userid)
;Message("Your password", password)
;Message("Your email", sender)
;Message("Send Email to",tolist)
;Message("Your Subject",subject)
;Message("Your Message body",body)

AddExtender("WWPST34I.DLL")
attachments=""
flags="h"
kInit(mailhost,sender,userid,password,'')
kDest(tolist,'','')
kSendText(subject,body,attachments,flags)
Exit

Save the files(.HTML and .WBT) to the same directory. Then Run the email.wbt file....



Article ID:   W14485
Filename:   Send Email with dialog.txt