<?php 
class mail
{
	// for sending mail
	function send_email($to,$message,$name,$fromname,$from=C_EMAIL)
	{
		//require ser'';
		require_once SERVER_ROOT.'/protected/library/swiftmail/swift_required.php';
		$transport=Swift_SmtpTransport::newInstance(SITE_ROOT);
		$mailer=Swift_Mailer::newInstance($transport);
		$message=Swift_Message::newInstance('Your details')->setFrom
		(array
				(
						$from=>$fromname
				))->setTo
				(
						array
						(
								$to=>$name
						))
						->
						setBody
						(
								$message
						);
		
		
		if($mailer->send($message))
	{
		return true;
		}
		else
		{
			return false;
		}
		
		}
}
?>