Jump to content

1 form to email different people


retrobsession

Recommended Posts

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

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.
    }
  }

?>

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.