Sending yourself a copy of the email I m using Drupal 7 with the Webform module to send email. On a form I have checkbox to send yourself an email copy. When it is checked, there will be a field to enter the email of who sends the email. The email should be send to this address also.
I created a custom module for this functionality. This module file used for creating a send a copy of message to me functionality



function sendmail_webform_form_alter(&amp;$form, &amp;$form_state, $form_id) {
     error_reporting(E_ALL);
     ini_set('display_errors', 1);   
     // webform_client_form_52  webform id
     if($form_id == 'webform_client_form_52') {     
         $form['submitted']['send_a_mail_yourself'] = array(
         '#type' =&gt; checkbox,
         '#form_key' =&gt; 'send_a_mail_yourself',
         '#title'=&gt; 'Send a copy of yourself',
         '#weight' =&gt; 4, // As your needed
         '#field_prefix' =&gt; '&lt;div id=\'send_a_mail_yourself\'&gt;',
         '#field_suffix' =&gt; '&lt;/div&gt;',
         '#default_value' =&gt; array('yes' =&gt; t('send a copy of yourself')),
       );
       $form['#submit'][] = '_sendmail_webform_submit';

       }
     }

   function _sendmail_webform_submit($form, &amp;$form_state) {        
     $param = array();
     foreach($form_state['input']['submitted'] as $key =&gt; $values) {
        if(valid_email_address($values)) {
             $to = $values; //to email address
        }
        else if($key == 'send_a_mail_yourself' &amp;&amp; $values == 1) {                    
              $send_a_mail = $values;  // Check send a mail to yourself checkbox

        } else {
          if($values) {
               $param[]  = $values;  // All remaining values to store to param array for use of email body
          }
        }            
       } 

          if($send_a_mail == 1) {                  
         $from = 'noreply@example.com';
                 foreach($param as $param_values) {
            $body[] = $param_values;
           }

        $to = $to; // Set this email address - emails will be sent to this email address!
        $params = array(
            'body' =&gt; $body,
            'subject' =&gt; 'Website Information Request',
     );
        if (drupal_mail('sendmail_webform', 'some_mail_key', $to, language_default(), $params, $from, TRUE)) {
            drupal_set_message('Thanks, we will be in contact with more information soon.');
     } else {
            drupal_set_message('There was an error subscribing you. Please try again later');
        }

    }      
  }

 function sendmail_webform_mail($key, &amp;$message, $params) {
     $headers = array(
         'MIME-Version' =&gt; '1.0',
         'Content-Type' =&gt; 'text/html; charset=UTF-8;',
         'Content-Transfer-Encoding' =&gt; '8Bit',
         'X-Mailer' =&gt; 'Drupal'
    );
    foreach ($headers as $key =&gt; $value) {
         $message['headers'][$key] = $value;
    }
      $message['subject'] = $params['subject'];
      $message['body'] = $params['body'];
 }