I have the attached code that sends an email. The code was generated from converting an action script.
I need to be able to check for result codes so I can determine if another script should run afterwards.
Any help appreciated.
Thanks
I need to be able to check for result codes so I can determine if another script should run afterwards.
Code:
'Send an e- mail message using the Alpha Five e-mail clilent. if is_object(topparent.this) then form_name = topparent.name()+".this" else form_name = "" end if template_text = a5_get_saved_email("Mail_Billto1") if template_text = "" then msg = "E-mail message is blank. If you are loading an e-mail template, then you may need to run this script from a button on a Form for the Table/Set in which the template was defined." ui_msg_box("Error",msg,UI_STOP_SYMBOL) end end if dim em as p dim param_to as c dim param_subject as c dim param_cc as c dim param_bcc as c dim message_type as c 'A5_email_parser() parses out the different sections of the e-mail template em = a5_email_parser(template_text) 'The template may have stored expressions rather than constant values for the address components. 'Expressions will be prefixed with '='. 'a5_eval_expression() will evaluate any expressions that are prefixed with '=' in the context of the current form. param_to = alltrim(a5_eval_expression(em.send_to_temp,local_variables())) param_subject = alltrim(a5_eval_expression(em.subject_temp,local_variables()) ) param_cc = alltrim(a5_eval_expression(em.cc_temp,local_variables())) param_bcc = alltrim(a5_eval_expression(em.bcc_temp,local_variables()) ) message_type = em.style 'Template message may have mail merge commands. a5_mailmerge() evaluates the mail merge commands. param_message = a5_mailmerge(em.message_body_temp,form_name) 'Put attachments into a zip file if more than one attachment is specified if w_count(em.attachments_temp,crlf()) > 1 then zipfile = file.temp_create(file.temp_path_get())+".zip" zip_files(zipfile,em.attachments_temp,.t.) param_attachments = zipfile else param_attachments = em.attachments_temp end if 'Send the e-mail using the Alpha Five e-mail client email_client(param_to,param_subject,param_message,param_attachments,param_cc,param_bcc,.f.,message_type)
Thanks
Comment