DenverR Posted August 13, 2010 Share Posted August 13, 2010 I'm using 3 files to try and mass mail my members, massmail.php massmail-exe.php and elist.php massmail.php <form name="massmail" method="post" action="./massmail-exe.php"> <table width="450px"> <tr> <td valign="top"> <label for="subject">Subject</label> </td> <td valign="top"> <input type="text" name="subject" maxlength="50" size="30" id="subject"> </td> </tr> <tr> <td valign="top"> <label for="message">Email Content</label> </td> <td valign="top"> <textarea name="message" maxlength="9001" cols="100" rows="18" id="message"></textarea> </td> </tr> <tr> <td colspan="2" style="text-align:center"> <input type="submit" value="Submit"> </td> </tr> </table> </form> massmail-exe.php <?php // read the list of emails from the file. $email_list = file("./elist.php"); // count how many emails there are. $total_emails = count($email_list); // go through the list and trim off the newline character. for ($counter=0; $counter<$total_emails; $counter++) { $email_list[$counter] = trim($email_list[$counter]); } // implode the list into a single variable, put commas in, apply as $to value. $to = implode(",",$email_list); if ( mail($to,$_POST["subject"],$_POST["message"]) ) { echo "The email has been sent!"; } else { echo "The email has failed!"; } ?> and elist.php which has the email addresses. What is wrong because every time i try and send it it say query failed. Thanks so much. Link to comment https://forums.phpfreaks.com/topic/210596-mailing-my-website-members/ Share on other sites More sharing options...
petroz Posted August 13, 2010 Share Posted August 13, 2010 There is no query for us to diagnose. Is there anything else on the elist.php file? Link to comment https://forums.phpfreaks.com/topic/210596-mailing-my-website-members/#findComment-1098687 Share on other sites More sharing options...
DenverR Posted August 13, 2010 Author Share Posted August 13, 2010 nope just emails on elist.php the only thing it says is query failed Link to comment https://forums.phpfreaks.com/topic/210596-mailing-my-website-members/#findComment-1098691 Share on other sites More sharing options...
petroz Posted August 13, 2010 Share Posted August 13, 2010 Does it say a line number? Link to comment https://forums.phpfreaks.com/topic/210596-mailing-my-website-members/#findComment-1098693 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.