note 112150 deleted from language.oop5 by googleguy

From: Date: Fri, 10 May 2013 11:06:44 +0000
Subject: note 112150 deleted from language.oop5 by googleguy
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-194770@lists.php.net to get a copy of this message
Note Submitter: hafiz_fp_bd at yahoo dot com ---- <?php /** * Description of bsmail class for mail send without attachment * @author Md.Hafizur Rahman */ class bsmail { var $header; var $subject; var $message; var $sendto; public function __construct() { $this->header.='MIME-Version: 1.0'; $this->header.="\r\n"; $this->header.='Content-type: text/html; charset=iso-8859-1'; $this->header.="\r\n"; } public function subject($sub) { $this->subject=$sub; } public function from($from) { $this->header.='From: '.$from; $this->header.="\r\n"; } public function reply($reply_to) { $this->header.='Reply-To: '.$reply_to; $this->header.="\r\n"; } public function cc($cc) { $this->header.='Cc: '.$cc; $this->header.="\r\n"; } public function bcc($bcc) { $this->header.='Bcc: '.$bcc; $this->header.="\r\n"; } public function to($to) { if(is_array($to)) { for($i=0;$i<count($to);$i++) { if($i==count($to)-1) { $this->sendto.=$to[$i];} else { $this->sendto.=$to[$i].","; } } } else { $this->sendto=$to; } } public function message($mes) { $this->message=$mes; } public function attach() { return 0; } public function send() { $this->header.='X-Mailer: BhyiyanSoft'; return @mail($this->sendto,$this->subject,$this->message,$this->header); } } $obj=new bsmail(); $obj->from('hafiz@bhuiyansoft.com'); $obj->to('hafiz_fp_bd@yahoo.com'); $obj->bcc('info@bhuiyansoft.com'); $obj->cc('help@bhuiyansoft.com'); $obj->subject('Information'); $obj->message('Hello......'); $obj->send(); ?>

« previous php.notes (#194770) next »