Friday, August 31, 2012

how to send mail html using php with example

function mailme($sendto,$sendername,$from,$subject,$sendmailbody,$bcc="")
{
global $SERVER_NAME;
$subject = nl2br($subject);
$sendmailbody = nl2br($sendmailbody);
$sendto = $sendto;
if($bcc!="")
{
$headers = "Bcc: ".$bcc."\n";
}
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=utf-8\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: PHP/"."MIME-Version: 1.0\n";
$headers .= "From: " . $from . "\n";
$headers .= "Content-Type: text/html\n";
mail("$sendto","$subject","$sendmailbody","$headers");
}
-------------------------------------------------------------
if you helpful my code please donate some few amount to
developing and free to post.
-------------------------------------------------------------

how to get htmlenties tag value in joomla

//in controller page

function store()
{
$row =& $this->getTable();
$data = JRequest::get( 'post');
/* Get proper HTML-code for your HTML-encoded field now by using JREQUEST_ALLOWHTML*/
$data['fielsd']=JRequest::getVar( 'fielsd', '', 'post', 'string', JREQUEST_ALLOWHTML );
/* now proceed as suggested */
$row->bind($data);
-------------------------------------------------------------
if you helpful my code please donate some few amount to
developing and free to post.
-------------------------------------------------------------