<p>Untitled Document
<!--
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style2 {font-size: 12px}
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }
.style4 {font-size: 12}
-->
<script type="text/javascript"></script>
</p>
<p><span class="style1"><span class="style2"><span class="style4"><span class="style2"><strong>MCR13: </strong></span><span class="style1"><span class="style2"><span class="style4"><span class="style2"><strong>How 
  to send an E-mail with attach using the macro sc_mail_send</strong></span></span></span></span><span class="style2"><strong> </strong></span></span></span></span></p>
<p><span class="style1"><span class="style2"><span class="style4"><span class="style1"><span class="style2"><span class="style4"><span class="style2"><strong>Application 
  Name:</strong></span></span></span></span><strong> </strong><span class="style2">mcr13_mail_attach<br /> <strong>Description: </strong></span><span class="style1"><span class="style2"><span class="style4"><span class="style2">Control 
  Form using macro to send email.</span></span></span></span><span class="style2"><br /> <strong><span class="style1"><span class="style2"><span class="style4"><span class="style2"><strong><span style="color: #000000;">Fields 
  that will be displayed</span></strong></span></span></span></span> in Control: </strong> <br /> </span><span class="style1"><span class="style2"><span class="style4"><span class="style2">name, 
  user, password, email_origin, email_destination, subject, message</span></span></span></span><span class="style2">, 
archive. </span></span></span></span></p>
<table border="1" cellspacing="0" width="80%" bordercolor="#666666">
<tbody>
<tr>
<td class="style3" width="188"><strong>Event:</strong></td>
<td class="style3" width="380">onValidate</td>
</tr>
<tr>
<td class="style3">
<p><strong>Code:</strong></p>
</td>
<td class="style3">
<p>$smtp = "smtp.gmail.com";</p>
<p>$name="{name}";</p>
<p>$subject={subject};</p>
<p>$description={message};</p>
<p>$annex=$this-&gt;Ini-&gt;path_doc.'/'.{file};</p>
<p>$body = "<strong>Name:</strong> ".$name."<br />"."<strong>Subject:</strong> ".$subject."<br /><br />".$description;</p>
<p>sc_mail_send($smtp,{user},{password},{email_origin},{email_destination},$subject,$body,"H",,,"465","S",$annex);</p>
<p>if ({sc_mail_ok}){<br /> sc_alert("Email successful sended!");</p>
<p>}else{<br /> sc_error_message({sc_mail_erro});<br /> }</p>
</td>
</tr>
</tbody>
</table>