Jump to content

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 info@mywebsite.com. 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: info@mysite.com\r\n";     
        $subj = "Your New User Account";
        $mailsend=mail("$email","$subj","$emess","From:info@mysite.com\r\nReply-To:info@mysite.com");
        header("Location: newmember.php");  

Link to comment
https://forums.phpfreaks.com/topic/56748-solved-email-a-copy-to-webmaster/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.