Webmaster Forum

Go Back   Webmaster Forum > Webmaster Discussion Forums > Web Design and Graphics

Notices

Reply
 
LinkBack Thread Tools Display Modes
Old 07-27-2008, 01:52 AM   #1
New Member
 
Join Date: Jul 2008
Posts: 3
Credits: 0
suforum is on a distinguished road
Default Submit form to multiple emails using a PHP form

Hi guys,

I would just like to know how to beable to submit a form to 2 email addresses.
I am using a .php form and this is how my html coding goes with a single email address:

$to = "address@email.com";
$from = $_POST['email'];
$subject = "Website Enquiry";

Let me know, thanks!


___________________
conservatories Fruit Machines
suforum is offline   Reply With Quote
Old 09-20-2008, 04:15 PM   #2
New Member
 
Join Date: Sep 2008
Posts: 19
Credits: 0
jnerotrix is on a distinguished road
Default Re: Submit form to multiple emails using a PHP form

<?php

$to = "address1@example.com";
$subject = "Message Subject";
$body = "Hello, \n\ Text Text text";
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message 1 delivery failed...</p>");
}

$to = "address2@example.com";
$subject = "Message Subject";
$body = "Hello, \n\ Text Text text";
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message 2 delivery failed...</p>");
}

?>
jnerotrix is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios