I am try to send a form to an email when I hit the submit button the page refreshes but no email is sent.
[php][/php]
Here is the Form:
[php]
Event Request
[/php]
and here is the send.php I know that the mail_sender.php works because we are using it to send email from anotheer page on the site.
[php]<?php
require_once( “…/…/common/SessionManager.php” );
require_once( “…/…/common/Utils.php” );
require_once( “…/…/common/Mail_Sender.php” );
SessionManager::CheckSession( SessionManager::IS_AJAX_REQUEST );
if ( isset( $_POST[“form_name”] ) &&
isset( $_POST[“form_email”] ) &&
isset( $_POST[“form_date”] ) &&
isset( $_POST[“msg_text”] ) )
{
$name = Utils::clean( $_POST[“form_name”] );
$email = Utils::clean( $_POST[“form_email”] );
$date = Utils::clean( $_POST[“form_date”] );
$text = Utils::clean( $_POST[“msg_text”] );
$body = "
Name: $name
Return Email: $email
Date of Event: $date
Comments: $text
$sender = new Mail_Sender();
$sender->SetFrom( "[email protected]" );
$sender->SetTo( array( “username @host.com” ) );
$sender->SetBcc( array( “” ) );
$sender->SetSubject( “Calendar Event Request” );
$sender->SetBody( $body );
$sender->SetType( Mail_Sender::HTML_TYPE );
$sender->SendMail();
}
else
echo “ERROR”;
exit();
?>
[/php]