New to using Expression Engine Classes and not sure how to use the Email class. I created the class and placed it within my template, but now i get a Parse Error. Again new to EE. How would I go about using this class, such as submitting the input fields. Here is my code.
<form method="post" id="vara-registration">
<?php
ee()->load->library('email');
ee()->load->helper('text');
ee()->email->wordwrap = true;
ee()->email->mailtype = 'text';
$errors = array();
foreach($member_emails as $username => $from)
{
ee()->email->from($from);
ee()->email->to("email@email.com");
ee()->email->subject(" Registration Request");
ee()->email->set_alt_message('User has requested Login verfication');
ee()->email->send();
if ( ! ee()->email->send())
{
$errors[] = ee()->email->print_debugger();
// Send failed, data was not cleared
ee()->email->clear();
}
?>
<p><label for="name">Name</label><input type="text" name="name" id="name_sec" value=""></p>
<p><label for="phone">Phone</label><input type="text" name="phone" id="phone_sec" value=""></p>
<p><label for="Email">Email</label><input type="text" name="email" id="email" value=""></p>
<p><input type="submit"></p>
</form>