note 112145 deleted from classobj.examples by googleguy
| From: | googleguy@php.net | Date: | Fri, 10 May 2013 11:05:32 +0000 |
| Subject: | note 112145 deleted from classobj.examples by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-194766@lists.php.net to get a copy of this message | ||
Note Submitter: hafiz at bhuiyansoft dot com
----
<?php
/**
* Description of bsmail class for mail send without attachment
* @author BhuiyanSoft
*/
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;
}
public function send()
{
$this->header.='X-Mailer: BhyiyanSoft';
return @mail($this->sendto,$this->subject,$this->message,$this->header);
}
}
?>