mail problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

mail problem

Post 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
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

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

?>
Post Reply