coltrane Posted September 2, 2009 Share Posted September 2, 2009 I have the following code for an email campaign: $Subject = $_POST['subject']; $content = $_POST['content']; while ($row = mysql_fetch_array ($result)){ $first_name=$row['first_name']; $last_name=$row['last_name']; $Emailto = $row['email']; $msg = "Dear $first_name $last_name, \n $content"; mail ($Emailto, $subject, $msg,$header ); How do I get $content to load up a predesigned page of pix and info? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/172873-email-content/ Share on other sites More sharing options...
ignace Posted September 2, 2009 Share Posted September 2, 2009 $subject = $_POST['subject']; $content = $_POST['content']; $template = $_POST['template']; while ($row = mysql_fetch_array ($result)){ $first_name=$row['first_name']; $last_name=$row['last_name']; $emailto = $row['email']; $header = "From: ..\r\nReply-To: ..\r\n"; if (!is_template($template)) {//load default $msg = "Dear $first_name $last_name,\n\n$content"; } else { $header .= "Content-Type: text/html"; $msg = load_template($template, $first_name, $last_name, $subject, $content); } if (!mail($emailto, $subject, $msg, $header)) { //mail was not send } } // verifies $template is indeed a template function is_template($template) { .. } // loads and returns the content of $template function load_template() { $args = func_get_args(); $template = array_shift($args); list($firstname, $lastname, $subject, $content) = $args; //.. } Quote Link to comment https://forums.phpfreaks.com/topic/172873-email-content/#findComment-911129 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.