mail problem
Posted: Wed May 10, 2006 7:13 am
is there any function in php that can support rich text email on windows server, i want to send mail from a windows server and text is not simple text but rich text.
thanx
thanx
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
require('../../Swift.php');
require('../../Swift/Swift_Sendmail_Connection.php');
$connection = new Swift_Sendmail_Connection;
$mailer = new Swift($connection, $_SERVER['SERVER_NAME']);
//If anything goes wrong you can see what happened in the logs
if (!$mailer->hasFailed())
{
//Sends a simple email
$mailer->send(
'"Joe Bloggs" <abdul.mannan@machsol.com>',
'"Your name" <you@yourdomain.com>',
'Some Subject',
"Hello <b> This is me </b> Joe it's only me!"
);
//Closes cleanly... works without this but it's not as polite.
$mailer->close();
}
else echo "The mailer failed to connect. Errors: ".print_r($mailer->errors, 1).". Log: ".print_r($mailer->transactions, 1);
?>