Jump to content


Email Contact Form


4 replies to this topic

#1 Crofty

    Young Padawan

  • Members
  • Pip
  • 32 posts

Posted 24 September 2006 - 06:57 AM

Hey, i am trying to make a email contact form for my website i can create one, but only for one recipent. i want to make one so that it has more than one, for example one being the site admin and the other being the product lister. any help would be appreciated.

thanks

#2 Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 24 September 2006 - 07:53 AM

Just off the top of my head here :blink:

<?php

$emails = array('mail@domain.com', 'mail2@domain.com');

foreach( $emails as $addr )
{
	mail($addr, $subject, $message, $headers);
}
?>

Just a basic idea for you ;)

#3 Crofty

    Young Padawan

  • Members
  • Pip
  • 32 posts

Posted 24 September 2006 - 08:01 AM

oh sorry did explain it well enough i mean like in a combo box so they choose who to send to

#4 Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 24 September 2006 - 08:12 AM

Ahh right i see.

HTML time :blink:

<select name="email">
	<option value="mail1@domain.com">Person One</option>
	<option value="mail2@domain2.com">Person Two</option>
</select>

Matt.

Edited by Matthew., 24 September 2006 - 08:12 AM.


#5 Hayden

    P2L Jedi

  • Members
  • PipPipPip
  • 716 posts
  • Gender:Male
  • Location:Texas

Posted 24 September 2006 - 08:22 AM

lol, I was looking for the way to send 1 email to multiple receipients.

# Common Headers
$headers .= 'From: Jonny <jon@genius.com>'.$eol;
$headers .= 'CC: Tony <tony@genius.com>'.$eol;
$headers .= 'Reply-To: Jonny <jon@genius.com>'.$eol;
$headers .= 'Return-Path: Jonny <jon@genius.com>'.$eol;	// these two to set reply address
$headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol;
$headers .= "X-Mailer: PHP v".phpversion().$eol;		  // These two to help avoid spam-filters

Edited by SpatialVisionary, 24 September 2006 - 08:24 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users