pietbez Posted April 27, 2007 Share Posted April 27, 2007 i am so new to this, can someone please tell me how to make <email> into a variable in the footer, just like <name> is currently a varialble in the header. thaks { //$headers .= "To: $name <$email>" . "\r\n"; $hf['header'] = str_replace('[name]', $name, $hf_header_tmp); $let_info['content'] = str_replace('[name]', $name, $let_info_tmp); $letter_body =$hf['header'].'<br>'.$let_info['content'].'<br>'.$hf['footer'].'<br>'; $letter_body = str_replace("\n.", "\n..", $letter_body); if (mail($email, $letter_title, $letter_body, $headers)) ++$oks; else ++$bads; } Link to comment https://forums.phpfreaks.com/topic/48864-email-variable-in-mail-footer/ Share on other sites More sharing options...
Caesar Posted April 27, 2007 Share Posted April 27, 2007 <?php $hf['footer'] = str_replace("[email]", $email, $hf['footer']); ?> Link to comment https://forums.phpfreaks.com/topic/48864-email-variable-in-mail-footer/#findComment-239485 Share on other sites More sharing options...
pietbez Posted April 27, 2007 Author Share Posted April 27, 2007 thanks Caesar Link to comment https://forums.phpfreaks.com/topic/48864-email-variable-in-mail-footer/#findComment-239488 Share on other sites More sharing options...
pietbez Posted April 27, 2007 Author Share Posted April 27, 2007 i am blatantly stupid. this is what i did and ofcource didnt work { $name = $members[$i]['name']; $email = $members[$i]['email']; if (valid_mail($email)) { //$headers .= "To: $name <$email>" . "\r\n"; $hf['header'] = str_replace('[name]', $name, $hf_header_tmp); $hf['footer'] = str_replace("[email]", $email, $hf['footer']); $let_info['content'] = str_replace('[name]', $name, $let_info_tmp); $letter_body =$hf['header'].'<br>'.$let_info['content'].'<br>'.$hf['footer'].'<br>'; $letter_body = str_replace("\n.", "\n..", $letter_body); if (mail($email, $letter_title, $letter_body, $headers)) ++$oks; else ++$bads; } else { ++$invalids; } } Link to comment https://forums.phpfreaks.com/topic/48864-email-variable-in-mail-footer/#findComment-239491 Share on other sites More sharing options...
Caesar Posted May 3, 2007 Share Posted May 3, 2007 Were you looking to replace the string '' or '<email>'? Link to comment https://forums.phpfreaks.com/topic/48864-email-variable-in-mail-footer/#findComment-244624 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.