Send form email button

hello!
I need to submit a form after it is compiled to a specific email address by an email button
thanks
Michele
I need to submit a form after it is compiled to a specific email address by an email button
thanks
Michele
function afterSave(&$record)
{
$app =& Dataface_Application::getInstance();
$respons =& Dataface_Application::getResponse();
if ($record->val('SendMail') == 'Yes'))
{
if (mail($MailTo, $Subject, $Message , $headers) == True)
{
$respons['--msg'] .= "\n --> Mail sent";
} else {
$respons['--msg'] .= "\n --> NO Mail sent";
}
}
}
function afterSave(&$record)
{
$app =& Dataface_Application::getInstance();
$respons =& Dataface_Application::getResponse();
if (mail($MailTo, $Subject, $Message , $headers) == True)
{
$respons['--msg'] .= "\n --> Mail sent";
}
}
[email]
label = "Email to"
description = "Email to an address"
order=11
category=table_tabs
condition="$query['-table'] == 'odl'"
url = "{$this->url('????????????)}"
permission=email
//__________________________________________________________________
//
var xmlHttp;
//__________________________________________________________________
//
function SentMail()
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url="includes/SentMail.php";
url=url+"?sid="+Math.random();
xmlHttp.onreadystatechange=function()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
Alert("Mail sent");
}
}
xmlHttp.open("GET",url,false);
xmlHttp.send(null);
}
//__________________________________________________________________
//
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
//Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}