Alpha Video Training
Results 1 to 2 of 2

Thread: Problem Sending Email from Template on Runtime

  1. #1
    Member
    Real Name
    Casy Laib
    Join Date
    Mar 2006
    Location
    Bismarck, ND
    Posts
    111

    Default Problem Sending Email from Template on Runtime

    I am having an issue with sending an email in the runtime version of my program. If I send it through the full version of the application it works properly, if I send it through the runtime version of the application the email is showing the raw HTML code, not the processed and formatted body.

    The code is sending the email to Outlook to allow it to be modified and edited a little better. I do not know if this is the problem with the runtime or something else. I know it works properly on my system but not on the runtimes.

    Anyone have any idea what could be causing this or what to look at? All of my code is automatically generated by Active Script so there may be something within there that is causing it to process it wrong. I have included the generated code for the button and the code for the email template below.

    Any help is appreciated!!
    Casy

    Code for email button:
    Code:
    'Send an e- mail message using the default external 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 = ""
    param_to = ""
    param_subject = ""
    param_cc = ""
    param_bcc = ""
    template_text = a5_get_saved_email("BSRO_EmailTemplate")
    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)
    
    param_message = a5_mailmerge(param_message,form_name)
    attachment_list = ""
    param_attachments = alltrim(attachment_list)
    'Send the e-mail using the external e-mail client
    email_client_external(param_to,param_subject,param_message,param_attachments,param_cc,param_bcc)

    Code for Email Template:
    Code:
    <send_to="">
    <subject="">
    <cc="">
    <bcc="">
    <attachments="">
    <message_body=<<%str%
    <link rel="stylesheet" type="text/css" media="screen" href="a5res:defaultStyle\(default)"/>
    <link rel="stylesheet" type="text/css" media="screen" href="a5res:defaultStyle\(default)"/><link rel="stylesheet" type="text/css" media="screen" href="a5res:defaultStyle\(default)"/><link rel="stylesheet" type="text/css" media="screen" href="a5res:defaultStyle\(default)"/><link rel="stylesheet" type="text/css" media="screen" href="a5res:defaultStyle\(default)"/><link rel="stylesheet" type="text/css" media="screen" href="a5res:defaultStyle\(default)"/><link rel="stylesheet" type="text/css" media="screen" href="a5res:defaultStyle\(default)"/><link rel="stylesheet" type="text/css" media="screen" href="a5res:defaultStyle\(default)"/><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><font color=#000000><font size=2><p><font face=Arial size=3>Cliff,</font></p><p><font face=Arial size=3></font>&nbsp;</p><p><font face=Arial size=3>Below are the wrenches from today that I need PO Number for.&nbsp; </font></p><p><font face=Arial></font>&nbsp;</p><p><table width=800 height=586>    <tbody>  <tr>                  <th width="100">      <p align=left><font face=Arial>Store #</font> </p> </th>                     <th width="100">      <p align=left><font face=Arial>Quantity</font></p></th>                <th width="100">      <p align=left><font face=Arial>Line Code</font> </p> </th>                        <th width="100">      <p align=left><font face=Arial>Serial #</font> </p> </th>               <th width="100">      <p align=left><font face=Arial>Total</font></p></th>                     <th width="100">      <p align=left><font face=Arial>PO #</font> </p> </th>       </tr><tr><td colspan="6" ></td></tr><!-- [.ONE_MANY:Cal_Header_Tmp] -->         <tr>                  <td>      <p><font face=Arial>[.IF 
          Cal_Readings_tmp-&gt;Serial_Number &lt;&gt; "" .and. 
          Cal_Readings_tmp-&gt;Toolofbatch =                                                               1]&lt;&lt;BSRO_BillingNum(Cal_Header_Tmp-&gt;Customer_Name)|&gt;&gt;[.END_IF]</p></font></TD>                 <td>      <p align=left><font face=Arial>[.IF Cal_Readings_tmp-&gt;Serial_Number &lt;&gt; "" 
          .and.Cal_Readings_tmp-&gt;Toolofbatch =          1][.IFCal_Header_Tmp-&gt;Boxsent =                                       .t.]&lt;&lt;Cal_Header_Tmp-&gt;Boxsentnum+Cal_Header_Tmp-&gt;Total_Tools||10|0&gt;&gt;[.ELSE]&lt;&lt;Cal_Header_Tmp-&gt;Total_Tools||10|0&gt;&gt;[.END_IF][.END_IF]</p></font></TD>                  <td><font face=Arial>[.IF 
          cal_readings_tmp-&gt;Serial_Number &lt;&gt; "" .and. 
          containsi(cal_readings_tmp-&gt;Result,"Condemned")]BSROCDOM[.END_IF][.IF 
          cal_readings_tmp-&gt;Serial_Number &lt;&gt; "" .and. 
          containsi(cal_readings_tmp-&gt;Result,"certified") .and. 
          cal_readings_tmp-&gt;preset =                 .t.]BSROPRETW[.END_IF][.IF       cal_readings_tmp-&gt;Serial_Number &lt;&gt; "" .and.       containsi(cal_readings_tmp-&gt;Result,"adjusted") .and.       cal_readings_tmp-&gt;preset =                   .t.]BSROPRETWREP[.END_IF][.IF        cal_readings_tmp-&gt;Serial_Number &lt;&gt; "" .and.        containsi(cal_readings_tmp-&gt;Result,"adjusted") .and.        cal_readings_tmp-&gt;unit = "inlb"]BSROTPMS[.END_IF][.IF        cal_readings_tmp-&gt;Serial_Number &lt;&gt; "" .and.        containsi(cal_readings_tmp-&gt;Result,"certified") .and.        cal_readings_tmp-&gt;unit = "inlb"]BSROMINTPMS[.END_IF][.IF        cal_readings_tmp-&gt;Serial_Number &lt;&gt; "" .and.        containsi(cal_readings_tmp-&gt;Result,"certified") .and.        cal_readings_tmp-&gt;unit =                    "ftlb" .and.        cal_readings_tmp-&gt;preset =                                                                                                .f.]  BSROADJTW[.END_IF][.IF       cal_readings_tmp-&gt;Serial_Number &lt;&gt; "" .and.       containsi(cal_readings_tmp-&gt;Result,"adjusted") .and.       cal_readings_tmp-&gt;unit =                                  "ftlb" .and.       cal_readings_tmp-&gt;calibration =                  59 .and.       cal_readings_tmp-&gt;preset =                                              .f.]BSROADMINJTW[.END_IF][.IF       cal_readings_tmp-&gt;Serial_Number                                   &lt;&gt; ""       .and.                   containsi(cal_readings_tmp-&gt;Result,"adjusted") .and.       cal_readings_tmp-&gt;unit =                                                                                                                                         "ftlb" .and.       cal_readings_tmp-&gt;calibration =                                                                                                   78 .and.       cal_readings_tmp-&gt;preset =                                 .f.]BSROMAJADJTW[.END_IF] </font> </td>                       <td><font face=Arial>[.IF       Cal_Readings_tmp-&gt;Serial_Number&lt;&gt;       ""]&lt;&lt;Cal_Readings_Tmp-&gt;Serial_Number|&gt;&gt;[.END_IF]</font>        </td>                    <td><font face=Arial>[.IF       Cal_Readings_tmp-&gt;Serial_Number&lt;&gt;       ""]&lt;&lt;Cal_Readings_Tmp-&gt;Labor+Cal_Readings_Tmp-&gt;Calibration+Cal_Readings_Tmp-&gt;Shipping+Cal_Readings_Tmp-&gt;Handling+Cal_Readings_Tmp-&gt;Rushcharge|$(|10|2&gt;&gt;[.END_IF]</font>        </td><td><font face=Arial></font></td></TR>     <tr>                  <td><font face=Arial></font></td>                    <td><font face=Arial></font>   </td>                     <td vAlign=top background="">      <p><font face=Arial>&lt;&lt;if(       Cal_Readings_tmp-&gt;Toolofbatch = Cal_Header_tmp-&gt;Total_Tools .and.       Cal_Header_tmp-&gt;Boxsent =  .t.,"BSROBOX","")|&gt;&gt;       </font></p></td>                              <td vAlign=top background="">      <p><font face=Arial>&lt;&lt;if(       Cal_Readings_tmp-&gt;Toolofbatch = Cal_Header_tmp-&gt;Total_Tools .and.       Cal_Header_tmp-&gt;Boxsent =  .t.,"Box       Shipped&nbsp;  (" + cal_header_tmp-&gt;boxsentnum +       ")","")|&gt;&gt; </font>              </p>      <p align=right><strong><font                                             
          face=Arial 
         >&lt;&lt;if(Cal_Readings_tmp-&gt;Toolofbatch =           Cal_Header_tmp-&gt;Total_Tools,"Total:&nbsp;       ","")|&gt;&gt;</font></strong></p></td>                           <td vAlign=top background="">      <p><font face=Arial>[.IF       Cal_Readings_tmp-&gt;Toolofbatch = Cal_Header_tmp-&gt;Total_Tools .and.       Cal_Header_tmp-&gt;Boxsent =  .t.]       &lt;&lt;Cal_Header_tmp-&gt;Boxsentnum  * 14|$(|10|2&gt;&gt;[.END_IF] </font></p>      <p><font face=Arial><strong>[.IFCal_Readings_tmp-&gt;Toolofbatch =                   Cal_Header_tmp-&gt;Total_Tools]&lt;&lt;Cal_Header_tmp-&gt;Final_Price|$(|10|2&gt;&gt;[.END_IF]</strong></font></p></td>                      <td><font face=Arial></font>   </td>     </tr><tr><td colspan="6"></td><!-- [.END_ONE_MANY] --></tr></TBODY></TABLE><p>&nbsp;</p></FONT></FONT></body></html> %str%>
    <style="HTML">

  2. #2
    Member
    Real Name
    Casy Laib
    Join Date
    Mar 2006
    Location
    Bismarck, ND
    Posts
    111

    Default Re: Problem Sending Email from Template on Runtime

    Looks like saving the template to an external txt file solved the issue. Works good now.

Similar Threads

  1. Can Runtime Plus Create an Email Template
    By forskare in forum Alpha Five Version 10 - Desktop Applications
    Replies: 10
    Last Post: 07-19-2010, 09:28 AM
  2. Replies: 1
    Last Post: 05-26-2008, 07:04 PM
  3. Cheking email account befor sending email
    By mmaisterrena in forum Alpha Five Version 8
    Replies: 2
    Last Post: 04-03-2008, 02:51 AM
  4. Sending Email Problem
    By Phil Rolf in forum Web Application Server v7
    Replies: 3
    Last Post: 05-08-2006, 05:26 PM
  5. Problem Sending email in V7 runtime
    By gregclifford in forum Alpha Five Version 7
    Replies: 15
    Last Post: 05-04-2006, 06:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •