evaluate_string()
Example - from Contact Us
'poplulate variables
dim vcountry as c = e.datasubmitted.country
dim vfax as c = e.datasubmitted.fax
dim vcomment as c = e.datasubmitted.comment
dim msg as c
'set the message text boilerplate
msg = <<%txt%
Contact_from...: {vapp_name}
Contact_origin.: {vapp_url}
Sent_at .......: {now()}
Contact_ID.....: {alltrim(str(vcontactid))}
---------------------------------------------
Company........: {vcompany}
Email..........: {vemailaddress}
Firstname......: {vfname}
Lastname.......: {vlname}
Telephone......: {vtelephone}
Timestamp......: {now() + crlf(2)}
Message........: {vcomment}
{crlf(2)}
%txt%
'open the SMTP to send mail
email_smtp_open(ps,smtp_server,smtp_port,smtp_uname,smtp_pwd)
'replace all variables with values
msg = evaluate_string(msg)
'start code to send the email
pm.to = vcontact_email
pm.subject = vcontact_subject
pm.message = msg
email_smtp_send(pm,ps)
...........