PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Email HTML Format not coming

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Mail
View previous topic :: View next topic  
Author Message
kranti



Joined: 28 Jul 2008
Posts: 1

PostPosted: Mon Jul 28, 2008 12:08 pm    Post subject: Email HTML Format not coming Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Mail All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
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



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software