safetguy Posted September 22, 2009 Share Posted September 22, 2009 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 More sharing options...
MatthewJ Posted September 22, 2009 Share Posted September 22, 2009 $to = $OWNER_EMAIL.", youremail"; Link to comment https://forums.phpfreaks.com/topic/175129-php-mail-help/#findComment-922990 Share on other sites More sharing options...
Raphael diSanto Posted September 22, 2009 Share Posted September 22, 2009 http://us.php.net/manual/en/function.mail.php 4th example down. It has both a CC and a BCC in it. Link to comment https://forums.phpfreaks.com/topic/175129-php-mail-help/#findComment-922991 Share on other sites More sharing options...
safetguy Posted September 22, 2009 Author Share Posted September 22, 2009 Matthew, worked great. Now I need to find a way to make it invisable like a bcc: Any Ideas? Link to comment https://forums.phpfreaks.com/topic/175129-php-mail-help/#findComment-923000 Share on other sites More sharing options...
MatthewJ Posted September 22, 2009 Share Posted September 22, 2009 Raphael's link above should help... one of the examples shows cc and bcc Link to comment https://forums.phpfreaks.com/topic/175129-php-mail-help/#findComment-923028 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.