 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
kranti
Joined: 28 Jul 2008 Posts: 1
|
Posted: Mon Jul 28, 2008 12:08 pm Post subject: Email HTML Format not coming |
|
|
Hi,
I have the requirement to send a mail through another SMTP credintials and hence i installed Pear::Mail. Mails are going fine. When I send HTML content it is properly displayed in the yahoo mail or gmail but coming to my qmail server it doesnt show the HTML content properly. Can anyone help me with this. Even when I send the mail in the qmail server it says that the mail contains Bad Mime. Please help me with this.
Code I am using:
------------------------
$text = $Message;
$html = $Message;
$file = $attachment_array;
$crlf = "\r\n";
$hdrs = array(
'From' => $From,
'To' => $To,
'Subject' => $Subject
);
$host='mail.example.com';
$port='25';
$username='peartest@example.com';
$password='tettet123';
$mime = new Mail_mime($crlf);
$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$mime->addAttachment($file, 'text/plain');
$mime->setSubject($Subject);
if($From) {
$mime->setFrom($From);
}
if($Cc) {
$mime->addCc($Cc);
}
if($Bcc) {
$mime->addBcc($Bcc);
}
$body = $mime->get();
$hdrs1 = $mime->headers($hdrs);
$mail = new Mail_smtp(array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password));
$mail->send($To, $hdrs1, $body); _________________ Kranti
Startes |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|