How to submit webform programmaticaly?
webform can be programatically save, as shown in below example,

  $node = node_load($nid); //nid is the node id of your webform
  global $user;

 //the values to save
  $data = array(
    1 =&gt; array('value' =&gt; array($first_value)),
    2 =&gt; array('value' =&gt; array($second_value)),
  );

  $submission = (object) array(
    'nid' =&gt; $nid,
    'uid' =&gt; $user-&gt;uid,
    'submitted' =&gt; REQUEST_TIME,
    'remote_addr' =&gt; ip_address(),
    'is_draft' =&gt; FALSE,
    'data' =&gt; $data,
  );

  module_load_include('inc', 'webform', 'includes/webform.submissions');
  webform_submission_insert($node, $submission);
  webform_submission_send_mail($node, $submission);