Page 1 of 1

Email Sending with multiple body's ?

Posted: Thu Nov 20, 2003 9:44 am
by gavinbsocom
This is the second time im posting an email question an its the last. I wont to have multiple forms combined into one message so when someone clicks send it takes all the forms to my email.


Challenge.php

Code: Select all

<form method="post" action="mail.php"> 
TO : <input type="text" name="to" value="russian@bniclan.com">
SUBJECT : <input type="text" name="subject" value="">
Clan Name : <input type="text" name="msg1" value="">
Clan Tag : <input type="text" name="msg2" value="">
Leader Name : <input type="text" name="msg3" value="">
Time (eastern) : <input type="text" name="msg4" value="">
Server : <input type="text" name="msg5" value="">
Password : <input type="text" name="msg6" value="">
FROM : <input type="text" name="from" value="email@address">
<input type="submit" value="Send Email"> 
<input type="reset">
</form>
Mail.php

Code: Select all

<?php 

$complete = "Email Sent !"; 

if($sent) 
  &#123; 
  echo "$complete"; 
  &#125; 
    elseif($complete) 
    &#123; 
    header('location:http://www.bniclan.com'); 
    &#125; 
      else 
      &#123; 
      echo "Email Failed."; 
      &#125; 

?> 
<html> 
<body> 

<?php 

$to = $_POST&#1111;"to"]; 
$subject = $_POST&#1111;"subject"]; 
$message = $_POST&#1111;"msg1" + "\n\r" + "msg2" + "\n\r" + "msg3" + "\n\r" + "msg4" + "\n\r" + "msg5"]; 
$from = $_POST&#1111;"from"]; 

sent = mail($to, $subject, $message, $from); 

?> 

</body>
</html>
Understand what im trying to do? I'm tryign to have seperate forms that combine to the message and then is sent to my email. when the email is then opened then each form is on its own line.......Any Ideas?

Posted: Thu Nov 20, 2003 9:48 am
by Weirdan
use $message = $_POST["msg1"]."\n\r".$_POST["msg2"]."\n\r".$_POST["msg3"]."\n\r".$_POST["msg4"]."\n\r".$_POST["msg5"];

Posted: Wed Dec 03, 2003 9:26 am
by gavinbsocom
it doesnt send ?

Posted: Wed Dec 03, 2003 9:50 am
by Nay
How about:

Code: Select all

$message = <<< MESSAGE
{$_POST['msg1']}
{$_POST['msg2']}
{$_POST['msg3']}
{$_POST['msg4']}
{$_POST['msg5']}
MESSAGE;
or also:

Code: Select all

$message = $_POST['msg1'] . '\r\n' . $_POST['msg2'] . '\r\n' . $_POST['msg3'] . '\r\n' . $_POST['msg4'] . '\r\n' . $_POST['msg5'];
MESSAGE;
-Nay