15/02/2013 12:11am

PHP | Problem - Email Send


function SubmitBooking($data, $form) {


$Booking = new Booking();
$form->saveInto($Booking);

$form->makeReadonly();
$email = new Email;
$email->to = 'josh@novaweb.co.nz'; //change to correct email for live site
$email->from = 'josh@novaweb.co.nz'; //change to correct email for live site
$email->subject = 'New Booking';
$email->body = $form->forTemplate();
$email->send();

$Booking->write();

// Redirect to a page thanking people for registering
Director::redirect('thanks-for-your-booking/');

}


1 Comments 1 Solutions

15/02/2013 12:19am

PHP | Solution - Anonymous

	function SubmitBooking($data, $form) {

$Booking = new Booking();
$form->saveInto($Booking);

$form->makeReadonly();
$email = new Email();
$email->setTo = 'josh@novaweb.co.nz'; //change to correct email for live site
$email->setFrom = 'josh@novaweb.co.nz'; //change to correct email for live site
$email->setSubject = 'New Booking';
$email->setBody = $form->forTemplate();
$email->send();

$Booking->write();

// Redirect to a page thanking people for registering
Director::redirect('thanks-for-your-booking/');

}

Post Comment