retrobsession Posted February 12, 2008 Share Posted February 12, 2008 Hi everyone, First post for me so here goes. I have a for sale section on my website but I want people to be able to click on a link next to the item that allows them to email the recipient, is there some code that will alow me to handle it all from one contact form for all contacts. Thanks, Mark Link to comment https://forums.phpfreaks.com/topic/90675-1-form-to-email-different-people/ Share on other sites More sharing options...
trq Posted February 12, 2008 Share Posted February 12, 2008 Its not really clear what your trying to do, but you could simply have a text field which your users can input email addresses seperated by , then simply explode by , to send the emails. eg; <?php if (isset($_POST['submit'])) { $recipients = explode(',',$_POST['recipients']); foreach ($recipients as $email) { // send mail. } } ?> Link to comment https://forums.phpfreaks.com/topic/90675-1-form-to-email-different-people/#findComment-464775 Share on other sites More sharing options...
retrobsession Posted February 12, 2008 Author Share Posted February 12, 2008 Hi, I'll try and explain a little more Ok, e.g. I have 10 items for sale on my for sale page by 10 different people and a potential seller wants to contact any one them. I want them to be able to click on a link which will launch a contact form, they will fill in item of interest, their email address, press submit and the email will go to the particular seller. I know I could create a contact form for each person/item but that is a lot of work so I was wondering if I could acheive the same using a single file but referecing a list with all the individual email addresses in so if they sellect contact seller 1, the email goes to seller 1 and so on. e.g. item 1 - seller email = [email protected], item 2 - seller email = [email protected] Thanks, Mark Link to comment https://forums.phpfreaks.com/topic/90675-1-form-to-email-different-people/#findComment-464783 Share on other sites More sharing options...
trq Posted February 12, 2008 Share Posted February 12, 2008 Were going to need to see some code. Assuming your sellers are allready related to the items they are seeling this should be simple. Are your items stored within a database, and if so, are the sellers email addresses also? Link to comment https://forums.phpfreaks.com/topic/90675-1-form-to-email-different-people/#findComment-464787 Share on other sites More sharing options...
retrobsession Posted February 12, 2008 Author Share Posted February 12, 2008 These are simply images at the moment with no contact facility, I have no database as it's simply a website using html and stylesheets Link to comment https://forums.phpfreaks.com/topic/90675-1-form-to-email-different-people/#findComment-464815 Share on other sites More sharing options...
trq Posted February 12, 2008 Share Posted February 12, 2008 Then you going to be a bit stuck. You need to relate each item to a seller, then it would be simple. Link to comment https://forums.phpfreaks.com/topic/90675-1-form-to-email-different-people/#findComment-464818 Share on other sites More sharing options...
retrobsession Posted February 12, 2008 Author Share Posted February 12, 2008 Umm, thought so. Any ideas for a simple database I can download, I can support mysql Link to comment https://forums.phpfreaks.com/topic/90675-1-form-to-email-different-people/#findComment-464825 Share on other sites More sharing options...
trq Posted February 12, 2008 Share Posted February 12, 2008 Its not simply a matter of downloading a database. Your looking to setup a simple ecommerce site by the sounds of it, unfotunately, this isn't so simple. Link to comment https://forums.phpfreaks.com/topic/90675-1-form-to-email-different-people/#findComment-464828 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.