Sending e-mail

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • divyac
    New Member
    • Aug 2008
    • 40

    Sending e-mail

    I have created an address book using php and mysql...I have provided check boxes for all my contacts list.Now my requirement is that i just want to check the required contacts and send e-mail to all those checked contacts at once..Is it possible with php?

    Thanks
    Divya
  • ak1dnar
    Recognized Expert Top Contributor
    • Jan 2007
    • 1584

    #2
    If the problem is with getting the check box values;

    here is the solution
    [html]

    <form id="form1" name="form1" method="post" action="mail_sc ript.php">
    <input type="checkbox" name="email[]" value="email1@d omain.com"/>
    <input type="checkbox" name="email[]" value="email2@d omain.com"/>
    <input type="checkbox" name="email[]" value="email3@d omain.com"/>

    <input type="submit" name="button" id="button" value="Submit" />

    </form>
    [/html]

    [PHP]
    <?php
    $mail = $_POST['email'];
    var_dump($mail) ;
    ?>
    [/PHP]

    on selecting 1st and 3rd checkboxes, output will be
    Code:
    array(2) { [0]=>  string(17) "email1@domain.com" [1]=>  string(17) "email3@domain.com" }
    If the problem is with mail function;
    You can pass multiple email addresses to php's mail function. read the manual here


    And finally, I highly recommend you to use phpmailer for better performance.

    Comment

    Working...