I got a problem: Until today, I sent HTML mails with PHP using a header which contains
Content-type: text/html;
Now, I added functionality
SWIFTMAIL in php works gr8 for attachment with mails.
Download swiftmailer from here http://swiftmailer.org/
Look at the simple code below
INCLUDE FILE
require_once('path/to/swiftMailer/lib/swift_required.php');
CREATE TRANSPORT
//FOR SMTP
// Create the Transport
$transport = Swift_SmtpTransport::newInstance('smtp.googlemail.com', 465, 'ssl')
->setUsername('user@gmail.com')
->setPassword('gmailpassword');
OR
//FOR NORMAL MAIL
$transport = Swift_MailTransport::newInstance();
MAILER OBJECT
// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
CREATE MESSAGE OBJECT
$message = Swift_Message::newInstance($subject)
->setFrom(array($from => $from))
->setTo($to)
->setBody($body);
$message->attach(Swift_Attachment::fromPath($filepath));
SEND MESSAGE
$result = $mailer->send($message);