my class for sending to email
Posted: Sun Aug 14, 2011 4:01 pm
Hello All 
this my 2nd topic here
i've done a new class for sending msgs to email
anyways
this is the class :
how to use :
the first parm for the contact , 2nd for ur email , 3rd subject of ur msg , 4th for ur msg
this it
have a nice day
this my 2nd topic here
i've done a new class for sending msgs to email
anyways
this is the class :
Code: Select all
<?php
/**
* @author ODAI
* @copyright 2011
* @contact dodi-505@hotmail.com
*/
class send_email{
/** Sending info */
private $from;
private $to;
private $subject;
private $msg;
/** 4 params for sending info */
function __construct($to,$from,$sub,$msg)
{
$this->from =$from;
$this->to =$to;
$this->subject=$sub;
$this->msg =$msg;
}
/** function for Headers */
function Headers()
{
$headers = "From:".$this->from . "\r\n";
$headers .= "To:".$this->to . "\r\n";
$headers .= "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();
return $headers;
}
/** function for sending the msg */
function send(){
if(mail($this->to,$this->subject,$this->msg,$this->Headers()))
{
return "your msg has been sent to : <br />".$this->to ;
}
}
}
?>
Code: Select all
$n=new send_email("x@hotmail.com","x1@hotamil.com","Hello","title");
echo $n->send()
this it
have a nice day