HTML and Mail

  • Edit

html_processfile ( htmlname )

 

This procedure is called in order to "run" the initial HTML file htmlname and to produce the final HTML file. The initial HTML file contains code in AutoScript. This code can communicate with the database or do other calculations in order 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", "0")
if (sched_date <> "") then
   call mail_setparam ( mail_id, "SCHED_FLAG", "1")
   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)