Jump to content

[SOLVED] email a copy to webmaster


tqla

Recommended Posts

Hi. I have put together this script to input a new user into a DB and email them a welcome email. It works fine.

 

Is it possible to send a copy of this welcome email to me? If my email address is "me @ mysite.com" can I add it to the $mailsend string? How? I've tried a few things but nothing worked. :(

 

        $today = date("Y-m-d");
  $date=time();                          
        $sql = "INSERT INTO Member (loginName,createDate,password,firstName,lastName,company,title,email,phone,dayCounter) VALUES
                ('$newname','$today','$newpass','$firstName','$lastName','$company','$title','$email','$phone','$date')";
        mysql_query($sql);         
        $emess = "A new user account has been established for $firstName $lastName. ";
        $emess.= "Your new username and password are: ";
        $emess.= "\n\n\tUsername: $newname\n\t Password: $newpass\n\n";
        $emess.= "Your username and password will expire in 60 days, at which time you will be requested to re-register. ";
        $emess.= "If you have any questions or problems, please email [email protected]. Or, contact us.";
  $emess.= "\n\nThank You,\n";
  $emess.= "\n\n(Please note that this is an automated response so please do reply to this email.)\n\n";
        $ehead="From: [email protected]\r\n";     
        $subj = "Your New User Account";
        $mailsend=mail("$email","$subj","$emess","From:[email protected]\r\nReply-To:[email protected]");
        header("Location: newmember.php");  

Link to comment
https://forums.phpfreaks.com/topic/56748-solved-email-a-copy-to-webmaster/
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.