Jump to content

PHP mail() help


safetguy

Recommended Posts

Im a PHP newbie and its a love/hate relationship.

 

I would like to add an additional email recipient to the following script. Curently the user gets an email once they sucessfully submit their info but I do not know that they have submitted it. I would like the form/script to also send me an email so that I know that someone has signed up.

 

mysql_query("SELECT df_email FROM site_specs") or die (mysql_error());

	// multiple recipients
$to  = $OWNER_EMAIL;

// subject
$subject = 'Account Registration';

// message
$message = '
<html>
<head>
<title></title>
</head>

<body>
<table width="100%" border="0">
  <tr>
    <td height="39" bgcolor="#3399CC"><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Thank
      you for registering today!</strong></font></td>
  </tr>
  <tr>
    <td height="31" valign="top"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif">Dear '.$OWNER_NAME.',</font></td>
  </tr>
  <tr>
    <td> <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Congratulations,
        you now have a member account with us. Please log-in with your details
        below:</font></p>
      <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Username:
        '.$USERNAME.'</strong></font></p>
      <p><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Password:
        '.$PASSWORD.' </font></strong></p></td>
  </tr>
  <tr>
    <td> </td>
  </tr>
  <tr>
    <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Kind Regards,<br>
      Administration</font></td>
  </tr>
</table>
</body>
</html>


';

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'From: Administration <$df_email>' . "\r\n";

// Mail it
mail($to, $subject, $message, $headers);

	$PROCESSED = 1;

}


}
?>



<html>

<head>



<title></title>
<?if ( $PROCESSED ==1 ) {

echo '<META HTTP-EQUIV="refresh" content="0;URL=index.php">';

} else {

echo '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">';

}

?>


<style type="text/css">

<!--

a:visited	{ text-decoration: none; }

a:link		{ text-decoration: none; }

a:hover		{ text-decoration: underline; }

body,td		{

			font-family: arial, helvetica; font-size: 11px; color: #484848;

			scrollbar-face-color: #E0E0E0;

			scrollbar-highlight-color: #E0E0E0;

			scrollbar-3dlight-color: #AAAAAA;

			scrollbar-darkshadow-color: #AAAAAA;

			scrollbar-shadow-color: #E0E0E0;

			scrollbar-track-color: #777777;

			}

.sidelink	{ line-height: 25px; color: #FFFFFF; }

.main		{ line-height: 22px; }

-->

</style>


</head>


<div align="center">

<table width="553" bgcolor="#FFFFFF">

<tr>

	<td width="599" height="403" align="center" valign="top"> <div align="left"></div>

	<div align="left">

	<table width="540" height="1107" align="center">

		<tr>

			<td height="77" valign="top"><p><font size="3"><strong>Create
                  an Account</strong></font></p>
                <p>If you do not receive our emails after registering please check
                  your Junk Mail box or filter. If you still haven't received it
                  please contact us about your account.</p></td>

 

Link to comment
https://forums.phpfreaks.com/topic/175129-php-mail-help/
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.