In the following code is to send an email using A5 email client and the body of email template. The email is sent ok with the attachments but the body of the email is unreadable (all codes). The code below comes from AS. There is something wrong with the syntax but unable to see where; it's way above my XBasic skills. Help will be much appreciated.
This is the code from A.S.
This is how the email arrives:
<link rel="stylesheet" type="text/css" media="screen" href="a5res:defaultStyle\(default)"/><html><head><meta name="generator" content="Alpha Five HTML Editor"><title></title><style><!--p { margin-top: 0; margin-bottom: 0 }--></style></head><body><table width="90%" border="1" bordercolor="#ffffff" cellpadding="0" cellspacing="0" background="" > <tr> <td> <FONT size=2>Hello Somebody : </FONT></td> </tr> <tr> <td> <FONT size=2>We missed you at the OCTOBER 23, 2009 Group Monthly Meeting.<BR>To keep you informed, I have attached the handouts from that session.
Thanks in advance
This is the code from A.S.
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 Dim message_type as c message_type = "" _to_var = a5_eval_expression("=Lookup(\"customers\", \"Custid_pk=\"+s_quote(Attendances->Custid_Fk), \"alltrim(email1)\")",local_variables()) param_to = _to_var subject_var = a5_eval_expression("=\"Reading Material for Session \"+Sessdate",local_variables()) param_subject = subject_var param_cc = "" param_bcc = "" attachments_var = a5_eval_expression("=Var->zattachmts",local_variables()) param_attachments = attachments_var template_text = a5_get_saved_email("HandoutTMessageBody") dim em as p 'A5_email_parser() parses out the different sections of the e-mail template em = a5_email_parser(template_text) 'Evaluate any mailmerge commands that may exist in the template by calling the a5_mailmerge() function. param_message = em.message_body_temp param_message = a5_mailmerge(param_message,form_name) 'Put attachment into a zip file zipfile = file.temp_create(file.temp_path_get())+".zip" zip_files(zipfile,attachments_var,.t.) param_attachments = zipfile 'Send the e-mail message directly - do not open the Alpha Five e-mail client send_result = email_send(param_to,param_subject,param_message,param_attachments,param_cc,param_bcc,.t.,message_type) if send_result <> 1 then ui_msg_box("Error","E-mail message was not sent.",UI_STOP_SYMBOL) end if
<link rel="stylesheet" type="text/css" media="screen" href="a5res:defaultStyle\(default)"/><html><head><meta name="generator" content="Alpha Five HTML Editor"><title></title><style><!--p { margin-top: 0; margin-bottom: 0 }--></style></head><body><table width="90%" border="1" bordercolor="#ffffff" cellpadding="0" cellspacing="0" background="" > <tr> <td> <FONT size=2>Hello Somebody : </FONT></td> </tr> <tr> <td> <FONT size=2>We missed you at the OCTOBER 23, 2009 Group Monthly Meeting.<BR>To keep you informed, I have attached the handouts from that session.
Thanks in advance
Comment