title: SendEmail Macro in Access 2010
body: <p>I have given a task to send email to the given e-mail address on button click. To achieve this task I performed the following steps i created  a form and a table customers. In my form I have a button and customer table with 2 field id and customer name. I wrote the following macro that would start on the button click.  </p>
  
  <hr>
  
  <pre><code>setLocalVar                     &lt;br&gt;
  Name email                      &lt;br&gt;
  Expression "hi@gmail.com"       &lt;br&gt;
  RunDataMacro                    &lt;br&gt;
  MacroName customers.DataMacro1  &lt;br&gt;
  Parameters                      &lt;br&gt;
  toEmail   ([LocalVars]![email]) &lt;br&gt;
  body      ([LocalVars]![email]) &lt;br&gt;
  subject   ([LocalVars]![email]) &lt;br&gt;
  </code></pre>
  
  <hr>
  
  <p>In customers table I wrote a data </p>
  
  <pre><code>macro(DataMacro1)
  Parameters Name     &lt;br&gt;
  toEmail             &lt;br&gt; 
  body                &lt;br&gt;
  subject             &lt;br&gt;
  SendEmail           &lt;br&gt;
  To       [toEmail]  &lt;br&gt;
  Cc                  &lt;br&gt;
  Bcc                 &lt;br&gt;
  Subject  [toEmail]  &lt;br&gt;
  Body     [toEmail]  &lt;br&gt; 
  </code></pre>
  
  <hr>
  
  <p>When I open my form in Form View Mode and Click on the button then a popup message alert is generated like Please ensure that your computer is configured to send and receive e-mail messages. But when I wrote a VB code instead of macro then it sends email perfectly but in my access 2010 project I have to send email by using macro. Can you tell me that is there something wrong in my macro or something is missing?     </p>