| | |
Email form
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2009
Posts: 34
Reputation:
Solved Threads: 0
Hello Guys,
I am not really sure how to ask this, but i will try my best, as much help will be apericiated.
I have a saved.php page which echos all saved data that i have filled inluding customer email. I then want a email.php to have echoing all emails stored, but i want a check box which when i tick and press submit sends a mass email to all users that i have checked.
Can someone please point me to the right direction or give a tutorial which shows similar to what i want.
Thank you
I am not really sure how to ask this, but i will try my best, as much help will be apericiated.
I have a saved.php page which echos all saved data that i have filled inluding customer email. I then want a email.php to have echoing all emails stored, but i want a check box which when i tick and press submit sends a mass email to all users that i have checked.
Can someone please point me to the right direction or give a tutorial which shows similar to what i want.
Thank you
Hi,
I hope you know how to send a mail to a user in php. If you know this, then the below code can help you.
Basic idea: Show a checkbox in front of every email id. Select and click a submit button to send emails to the selected email ids.
I hope you know how to send a mail to a user in php. If you know this, then the below code can help you.
Basic idea: Show a checkbox in front of every email id. Select and click a submit button to send emails to the selected email ids.
php Syntax (Toggle Plain Text)
<? if($_POST['submit'] == "Send Mass Mail") { // When someone presses submit button given below if(count($_POST['email_ids']) >0) { foreach($_POST['email_ids'] as $key) { //mail function - (to_field, subject_field,msg_field,headers) // Set it accordingly $subject = "Your mailer subject"; $to = $key; $msg = "Here is our product"; mail($to,$subject,$msg,$header); } } } ?> // This is the form that shows all the emails and the checkboxes <form name="emailfrm" method="post" action=""> <table border="0" cellpadding="2" cellspacing="1"> <thead> <tr> <th>Email Id</th> <th> </th> </tr> </thead> <tbody> <?php $res = mysql_query("Select email from <tablename>"); while($data = mysql_fetch_array($res)) { // Show all the emails from the database. Choose the tablename above ?> <tr> <td><?php echo $data['email']; ?></td> <td><input type="checkbox" name="email_ids" id="email_ids" value="<?php echo $data['email']; ?>" /></td> </tr> <?php } ?> <tr> <td colspan="2"><input type="submit" name="submit" id="submit" value="Send Mass Mail" /> </tr> </tbody> </table> </form>
•
•
Join Date: Jul 2009
Posts: 34
Reputation:
Solved Threads: 0
Thank you for that reply, i slightly understand what you are doing, but just tad hard for me to implement it to my form, as i am still learning lol. It is much apericiated for you taking your time in doing the code for me,
I have just thought if i can do it this way, where i have a text box which when i type the ID of that customer and press submit, it goes to MYSQL database gets the email and sends it.
Please note i have a datbase which gives id to every customer and has a section for email which is "EmailAD"
Thank you
I have just thought if i can do it this way, where i have a text box which when i type the ID of that customer and press submit, it goes to MYSQL database gets the email and sends it.
Please note i have a datbase which gives id to every customer and has a section for email which is "EmailAD"
Thank you
![]() |
Similar Threads
- Email form doesn't send everything (PHP)
- Edit email form replies to not show blank answers (HTML and CSS)
- Is it possible to create an "Email a Friend" or and email form... (ASP)
- email form problem (Web Hosting Deals)
- Simple Email Form (PHP)
- Please help with email form script (PHP)
- Need help with this email form (Java)
Other Threads in the PHP Forum
- Previous Thread: [php]executing 'pict'
- Next Thread: How we can fetch value on same page in PHP???
| Thread Tools | Search this Thread |
apache api array beginner binary broken cache cakephp checkbox class cms code confirm cron curl customizableitems database date display dynamic echo email error external fcc file files folder form forms forum freelancing function functions google header headmethod howtowriteathesis href htaccess html iframe image include insert ip javascript joomla limit link login mail malfunction menu method mlm mod_rewrite multiple mysql neutrality oop pageing pagerank paypal pdf php phpmysql play problem query question radio random recursion remote root script search select server sessions sms soap source space sql support! syntax system table template tutorial update upload url validator variable video web youtube





