NYCPHP Meetup

NYPHP.org

[nycphp-talk] Email not working

Joseph Crawford codebowl at gmail.com
Sat Nov 13 21:19:56 EST 2004


guys i have a mail function call however it is sending the HTML as
text and not an HTML email, can anyone here help me out?  Here are the
headers from the email source

To: codebowl at gmail.com
Subject: Demonoid Account Confirmation
MIME-Version: 1.0

Content-type: text/html; charset=iso-8859-1

From: Demonoid <accounts at demonoid.com>
X-Mailer: PHP/4.3.9\r\n
Message-Id: <20041114021655.2D9285282D8 at vt-fairhaven1a-82.bur.adelphia.net>
Date: Sat, 13 Nov 2004 21:16:55 -0500 (EST)

<html>
	<head>

and here is the code

	function sendRegistrationEmail( $configs, $tpl, $email, $confirm ) {
		$tpl->assign('code', $confirm);
		$tpl->assign('url', $configs->getSiteURL()."/confirm.php?code=".$confirm);
		$tpl->assign('confirm_page', $configs->getSiteURL()."/confirm.php");
		$sitename = $configs->getSiteName();
		$tpl->assign('sitename', $sitename);

		$body = $tpl->fetch('email/confirm_email.tpl');

		$headers  = "MIME-Version: 1.0\r\n";
		$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
		$headers .= "From: ".$sitename." <".$configs->getSiteEmail().">\r\n";
		$headers .= "X-Mailer: PHP/" . phpversion().'\r\n';
		
		mail($email, $sitename." Account Confirmation", $body, $headers) or
trigger_error('email not sent :(', E_USER_ERROR);
	}

i am not sure what is going on but it's not working :(

-- 
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com

For a GMail account
contact me OFF-LIST



More information about the talk mailing list