i have the following function in my page.php. its appears on every page as a quick contact form.
the problem is that it can populate the database but its not sending me the data thru email.
function submitContact($data, $form) {
$submission = new ContactFormSubmission();
$form->saveInto($submission);
$email = new Email($data->Email, "name@yourdomain.com", "Quick contact from website", $data->Message);
$email->send();
$submission->write();
Session::set('Contacted', true);
Director::redirectBack();
}