Jump to content

Modding a email send php file


big-dog1965

Recommended Posts

How would I get this to send an email to someone else: as well as the current $useremail address. This does work but it only sends to the person that fills in the form that this is referenced from.

I would like it to be coded in such a manner that in this file there would be and editable section that you put an email or a couple of emails in, to send to

 

// DO NOT EDIT BELOW THIS LINE, UNLESS YOU KNOW WHAT YOU ARE DOING
if ($username == "" or $userpass == "" or $useremail == ""){$msg3=true;}

$email = $useremail; 
if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", $email)) {
   $msg4 = true; $pass = "no"; }
if (!isset($useremail)) 
echo "Error, Please re-send $username" ; 

$todayis = date("l, F j, Y, g:i a") ;

$subject = "Registration";

$message = " $todayis [EST] \n

From: $sendersName \n
\n
Your user level will be set upon approval \n
This email was sent by an auto responder, you cannot reply to this email.

";

$from = "From: $sendersEmail";

if ($email != "") 
mail($email, $subject, $message, $from);

 

Link to comment
https://forums.phpfreaks.com/topic/146631-modding-a-email-send-php-file/
Share on other sites

I get an error

Parse error: syntax error, unexpected '@' in /home5/public_html/App/Admin/db/send.php on line 31 is the email address line.

 

if ($email != "") 
mail($email, $subject, $message, $from);
if ($email){
[email protected],[email protected]. ($email, $subject, $message, $username, $useremail);
}

?>

this:

if ($email){

[email protected],[email protected]. ($email, $subject, $message, $username, $useremail);

}

 

should be like within the if statement:

mail($to, $subject, $message, $headers);

 

remove:

if ($email != "")

mail($email, $subject, $message, $from);

They go within the $email variable, or you can put it on there in a while loop if you want it to loop through a mail script.

 

see the following code

// multiple recipients
$to  = '[email protected]' . ', '; // note the comma
$to .= '[email protected]';

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.