Jump to content

Email Script


robert4442

Recommended Posts

I have an email script in php that sents to two email addresses. I need to know how to expand this to send many more than two(Up to 10). Below is the script. This script is activated from another page with a form on it. iT IS ALOS BELOW I would aqppreciate your help.

***********************************************************************

<?php

$to = trim($_POST['to']);

$from = trim($_POST['from']);

$subject = trim($_POST['subject']);

$message = trim($_POST['message']);

$copy = '[email protected]';

//$bcc = "[email protected]";

$send = mail($to,$subject,$message,"FROM: ".$from."\n\rCC: ".$copy);

if ($send) {

echo "Sent";

} else {

echo "Error sending";

}

?>

*********************************************************************

<form action='sendmail.php' method='post'>

<p> </p>

<p><font color="#FF0000"><strong>EMAIL TO ATTORNEY GENERAL JOHN ASHCROFT</strong></font></p>

<p>TO:

  <input type='text' name='to'>

  <br>

  FROM:

  <input type='text' name'from'>

  <br>

  SUBJECT:

  <input type='text' name='subject'>

  <BR>

  Enter Message:<br>

  <textarea name='message'></textarea>

  <br>

  <br>

  <input type='Submit' value='Send Message'>

</p>

******************************************************

 

Link to comment
https://forums.phpfreaks.com/topic/50584-email-script/
Share on other sites

never used the ".$copy); but you could make several statments like

 

$send = mail($to_1,$subject,$message,"FROM: ".$from."\n\rCC: ".);

$send = mail($to_2,$subject,$message,"FROM: ".$from."\n\rCC: ".);

$send = mail($to_3,$subject,$message,"FROM: ".$from."\n\rCC: ".);

$send = mail($to_4,$subject,$message,"FROM: ".$from."\n\rCC: ".);

 

where $to_1 to _4 are individual email address.

 

rCC: ? never used that.

 

 

$success = mail($to,$sss, $mmm, $headers);

Link to comment
https://forums.phpfreaks.com/topic/50584-email-script/#findComment-248659
Share on other sites

otuatail, Is this what yopu mean?

 

<?php

$to = trim($_POST['to']);

$from = trim($_POST['from']);

$subject = trim($_POST['subject']);

$message = trim($_POST['message']);

$send = mail($to_1,$subject,$message,"FROM: ".$from."\n\rCC: ".);

$send = mail($to_2,$subject,$message,"FROM: ".$from."\n\rCC: ".);

$send = mail($to_3,$subject,$message,"FROM: ".$from."\n\rCC: ".);

$send = mail($to_4,$subject,$message,"FROM: ".$from."\n\rCC: ".);

if ($send) {

echo "Sent";

} else {

echo "Error sending";

}

?>

 

What do I do with this?

$success = mail($to,$sss, $mmm, $headers);

Link to comment
https://forums.phpfreaks.com/topic/50584-email-script/#findComment-249971
Share on other sites

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.