JeanieTallis Posted March 20, 2009 Share Posted March 20, 2009 <?php require 'administration.php'; if (isset($_POST['submit'])) { // if form has been submitted /* check they filled in what they supposed to etc: full name, email and comments */ if (!$_POST['comments']) { die('You did not fill in a required field, please refresh.'); } $_POST['comments'] = strip_tags($_POST['comments']); if (!get_magic_quotes_gpc()) { $_POST['comments'] = addslashes($_POST['comments']); } $message = "Dear Customer, \n $_POST[comments] \n _____________________________________________ Thank you. This is an automated response. PLEASE DO NOT REPLY. "; /* Mail To, subject, message */ mail ("CONNECT TO DATABASE TO GET CONTACTS","Todays Newsletter", $message, "From: \"Jeanies Poetry Corner\" <Newsletter@Jeanies-Poetry.com>\r\n " . phpversion()); die('Newsletter has been sent to all the recipents in our database'); exit; } ?> where it says "CONNECT TO DATABASE TO GET CONTACTS" I need to get the emails addresses from the database. The database the emails get stored in, is connected to 'Newsletter.php', So I know that require 'Newsletter.php'; Should be included in it somewhere. You may need to use this $_POST['email'] Is there any way to do this? Also, as it imports the email addresses from the database, when it sends, would it show all the email addresses that the email sent to on the users email they recieve? If you understand, to make it easier.. lets say, chain mails on MSN, you see all the recipents the email was sent to, would this show up with the code above but connected to the database? If it would show, are you able to stop that from happening, and codes would be nice Thanks Quote Link to comment https://forums.phpfreaks.com/topic/150382-importing-email-addresses-from-database-into-a-form-and-keeping-them-seperate/ Share on other sites More sharing options...
mrMarcus Posted March 20, 2009 Share Posted March 20, 2009 if you're talking hundreds of emails to be sent, (mass emailing), try connecting directly to the SMTP server to do so. otherwise, if it's just a few emails your script will be sending, you could always try just looping the mail function using 'foreach' on the results from the db query. Quote Link to comment https://forums.phpfreaks.com/topic/150382-importing-email-addresses-from-database-into-a-form-and-keeping-them-seperate/#findComment-789791 Share on other sites More sharing options...
JeanieTallis Posted March 20, 2009 Author Share Posted March 20, 2009 It will be mass emailing eventually, im not sure on SMTP mailing, only when it comes to C# do you have any idea what the PHP will be for the mass emailing (as im sure it'll work for few emails anyway) Quote Link to comment https://forums.phpfreaks.com/topic/150382-importing-email-addresses-from-database-into-a-form-and-keeping-them-seperate/#findComment-789801 Share on other sites More sharing options...
JeanieTallis Posted March 20, 2009 Author Share Posted March 20, 2009 Anybody know what to do? Quote Link to comment https://forums.phpfreaks.com/topic/150382-importing-email-addresses-from-database-into-a-form-and-keeping-them-seperate/#findComment-789908 Share on other sites More sharing options...
redarrow Posted March 21, 2009 Share Posted March 21, 2009 http://www.umailcampaign.com/ Quote Link to comment https://forums.phpfreaks.com/topic/150382-importing-email-addresses-from-database-into-a-form-and-keeping-them-seperate/#findComment-790075 Share on other sites More sharing options...
JeanieTallis Posted March 21, 2009 Author Share Posted March 21, 2009 I'm designing my own, I don't want to use premade stuff. Quote Link to comment https://forums.phpfreaks.com/topic/150382-importing-email-addresses-from-database-into-a-form-and-keeping-them-seperate/#findComment-790163 Share on other sites More sharing options...
redarrow Posted March 21, 2009 Share Posted March 21, 2009 the link i provided was a script that handles mass email's, it not wrong to use or a direct insult mate. we need to no how many email's your sending daily, php has not got the ability to do mass emailing that all. Quote Link to comment https://forums.phpfreaks.com/topic/150382-importing-email-addresses-from-database-into-a-form-and-keeping-them-seperate/#findComment-790184 Share on other sites More sharing options...
DeanWhitehouse Posted March 21, 2009 Share Posted March 21, 2009 phpmailer http://phpmailer.codeworxtech.com/ Quote Link to comment https://forums.phpfreaks.com/topic/150382-importing-email-addresses-from-database-into-a-form-and-keeping-them-seperate/#findComment-790225 Share on other sites More sharing options...
JeanieTallis Posted March 21, 2009 Author Share Posted March 21, 2009 I have installed phpmailer before, but im not sure how to actually make it work, it asks to type in header and footer and stuff, but im not like.. sure :/ but ill try again to see what i can do. Quote Link to comment https://forums.phpfreaks.com/topic/150382-importing-email-addresses-from-database-into-a-form-and-keeping-them-seperate/#findComment-790251 Share on other sites More sharing options...
redarrow Posted March 21, 2009 Share Posted March 21, 2009 will help you loads. http://phpmailer.codeworxtech.com/index.php?pg=tutorial#1 Quote Link to comment https://forums.phpfreaks.com/topic/150382-importing-email-addresses-from-database-into-a-form-and-keeping-them-seperate/#findComment-790263 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.