HTML and Mail
html_processfile ( htmlname )
We call this procedure to “run“ the initial HTML file htmlname and produce the final HTML file. The initial HTML file contains code in AutoScript. This code can communicate with the database or do other calculations to produce the final HTML file. The name of the final HTML file produced is the same as the initial plus a ‘‘_‘‘ at the beginning of the file name.
html_gettext ( htmlname )
This function returns the text of the file htmlname, as a string, to the caller.
The next example shows the usage of HTML processing to sending email:
call html_processfile (“MYMAIL_PROTO.HTML“, param1, param2, ...)
{..._MYMAIL_PROTO.HTML is created into the HTML folder of server‘‘s resources }
body_Text = html_gettext(“_MYMAIL_PROTO.HTML“)
mailbox_id = SelectFrom(“SELECT AU_MAIL_POP3 FROM AU_MAIL_POP3 WHERE (SMTP_USER=‘‘“,sender_mail,“‘‘)“)
mail_id = mail_create ( mailbox_id )
call mail_setparam ( mail_id, “FROM“, sender_mail)
call mail_setparam ( mail_id, “TO“, receip_mail)
call mail_setparam ( mail_id, “SUBJECT“, subject)
call mail_setparam ( mail_id, “PROCESS“, au_process)
call mail_setparam ( mail_id, “DRAFT_FLAG“, “)
if (sched_date <> ““) then
call mail_setparam ( mail_id, “SCHED_FLAG“, “)
call mail_setparam ( mail_id, “SCHED_DATE“, sched_date)
call mail_setparam ( mail_id, “SCHED_HOUR“, sched_hour)
end ;
mail_setparam ( mail_id, “BODY“, body_Text)
{ draft_flag = 0 send immediately }
{ draft_flag = 1 send later manualy }
au_mail = mail_send ( mailbox_id, mail_id, draft_flag)