Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Aug 2006
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts

    selecting mail-id after link click in php

    hi,

    i have a mysql table which contains client details.
    fields are as follows

    1.name 2.mailid 3.sendmail 4.status
    1.abc 2.abc@yahoo.com 3.send 4.not updated
    1.xyz 2.xyz@hotmail.com 3.send 4.not updated

    here 'send' is the link and when i click on it, it opens a email form to send mail to abc@yahoo.com or xyz@hotmail.com.i want to know how i can select the mailid from db when i click on 'send' link and print it on email form and i should send mail to that mail id.after sending mail to a person here 'status' should be updated. your help will be appreciated


    thanks

    mrjameer

  • #2
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,043
    Thanks
    19
    Thanked 42 Times in 42 Posts
    if you create a drop down or radio buttons for who to send the mail to should be easier or even a text area
    PHP Code:
    <?php
    include(connection.php);

    $result mysql_query("SELECT $mail FROM `mailid` WHERE `user` = `$user`);
    if (!$result)
    {
    echo "
    error running query";
    }
    else 
    {
    mail($result, 'your subject line', 'yourbody', 'yourheaders');
    }
    if(mail($result, 'your subject line', 'yourbody', 'yourheaders'))
    {
    header( Location : "
    http://server.com/sentmail.php?to=$result");

    else

    echo 
    "error sending mail";
    }

    mysql_close($db);

    ?>
    thats not it exactly but does it give u an idea?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •