Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Problem Sending Email from Template on Runtime

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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
    Re: Problem Sending Email from Template on Runtime

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

    Comment

    Working...
    X