acctman Posted September 14, 2008 Share Posted September 14, 2008 Currently my script uses the code below to send out a text formated reg_confirm.tpl email template. How can I change the coding so that it sends out HTML formated emails //parses email templates function emailtemplate($template_file) { global $en; $f = fopen($template_file,'r'); if (!$f) die('Couldn`t open '.$template_file.'!'); $lines = 0; while (!feof($f)) { $lines++; $s = chop(fgets($f,4096)); if ($lines == 1){ $out[subj] = $s;} else {$out[body] .= $s."\n";} } fclose($f); return emailtemplatetxt($out['subj'],$out['body']); } //send confirmation email $message = emailtemplate('emails/reg_confirm.tpl'); mail($en['email'], $message[subj], $message[body], "From: ".admin_email."\r\n" ."Reply-To: ".admin_email."\r\n" ."X-Mailer: PHP/" . phpversion()); Link to comment https://forums.phpfreaks.com/topic/124240-sending-html-email/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.