Page 1 of 1

mail problem

Posted: Wed May 10, 2006 7:13 am
by itsmani1
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

Posted: Wed May 10, 2006 9:31 am
by Chris Corbyn
You can send what you like using phpMailer, mail() or another alternative. Just set the appropriate content-type headers in the email.

Posted: Wed May 10, 2006 9:43 am
by Burrito
since d11 is too humble to link you to his own goods...I'll do it for him.

viewtopic.php?t=48055

:D

Posted: Fri May 12, 2006 1:19 am
by itsmani1
I tried send mail for windows server bit it did not worked.

i tried fowllowing code on windows server but it did not worked.

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);

?>