Forum Moderators: coopster
function Mailer(){
$this->to = "";
$this->from = "";
$this->cc = "";
$this->bcc = "";
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: '.$this->to . "\r\n";
$headers .= 'From: '.$this->from . "\r\n";
$headers .= 'Reply-To: '.$this->from . "\r\n";
$headers .= 'Cc: '.$this->cc . "\r\n";
$headers .= 'Bcc: '.$this->bcc . "\r\n";
$this->headers = $headers;
}
function setSubject(){
$this->subject = "subjects goes here..";
}
function setMessage($message){
# set Message
$message = <<<EOF
<html>
<head>
</head>
<body>
<p> </p>
<table width="455" border="0" align="center" cellpadding="0" cellspacing="10" bgcolor="#FFFFFF">
<tr>
<td width="88"><span class="field">Message</span></td>
<td width="289"><span class="fieldValue">$message</span></td>
</tr>
</table>
</body>
</html>
EOF;
$this->message = $message;
}
function sendMail(){
return mail($this->to, $this->subject, $this->message, $this->headers);
}
}
/**
* Usage
*/
$Mailer = new Mailer();
$Mailer->setSubject();
$Mailer->setMessage("Message goes here...");
$Mailer->sendMail();
?>[/php]
How to make the code working (ie output should displayed as text not the code and also the from section should be visible (Note i m using outlook express))
Thanks in advance to all of you
if so it won't work; (I believe)- MS outlook is not a PHP parser so your code needs to be server side “served” and mailed out of the mail server then the PHP will be exec.