Webform email component created programmatically I am trying to build an email confirmation utility into a web application. For some other project I might just use jQuery to insert a new text field beneath my email field and compare their input as soon as the user finishes typing into the created textfield.

The problem is the email authentication will fail if a user does not have javascript enabled on his/her browser.

To overcome this problem, I want to use code to programmatically create and insert a second textfield immediately after the actual email field and compare their input when the user submits.

What I don't know is what webform hook(s) I can use to create an email component.

Can anyone help with some information and/or code samples, please?
$email = array(
  'nid' =&gt; $node-&gt;nid,
  'email' =&gt; 'name@example.ch',
  'subject' =&gt; 'default',
  'from_name' =&gt; 'default',
  'from_address' =&gt; 'default',
  'template' =&gt; 'default',
  'excluded_components' =&gt; array(),
);
webform_email_insert($email);


Check this post for more info.