Here is how I do register sends and notifications.See if this is will help you...
/* in your php,after you have the username,put the username into the $tosubscriber var.
as below..*/
$tosubscriber = $email;
// enter your email----->$from = "YOUR EMAIL ADDRESS"; /*put your own email address here*/
$space= " ";
$headers = "MIME-Version=1.0"."\r\n";
$headers .="Content-type=text/html;charset=iso-8859-1"."\r\n";
// enter your email -> $headers .='From= <YOUR EMAIL>'."\r\n"; /* again put your own email*/
$bounce = "-f".$from; /*if bounce,will go to your inbox*/
$subject = "Put your subject here,such as,Download Link Info";
$comments = "Thank You".$space.$name.$space."for choosing /*your product*/
Here is your download link...
/* enter your download link info in this message field */
http://www.YOURSITE.com/YourDowloadLink/Download.html
contact me if you have any questions,or need setup assistance
"; /*note the message field close here */
$sent = mail($tosubscriber, $subject, $comments,$headers,$bounce);
if($sent){
/*next,if send was ok.then email yourself a message*/
/* email notifier----------------------------------------------------- */
// enter your info--->$to = "your email address";
$subject = "New ez-reg subscriber";
$comments = "Download link sent to.....".$name.$space.$email;
$sent = mail($to, $subject, $comments);
/*--- end notifier ------------------------------------------------------ */
That should do the trick.The only other thing I would stress is to validate user email
address inputs as follows...
$pat_email='/^[a-z0-9]+([-|_|.][a-z0-9]+)*\@([a-z0-9]+([-|.]{1}[a-z0-9]+)*\.(com|edu|biz|org|gov|ws|
info|mil|net|arpa|name|museum|coop|aero|bz|ch[a-z][a-z])|(\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]))$/';
if(!preg_match($pat_email,$email)){ $ok=false;
echo "please enter a valid email address";
echo "<br>";
echo "<a href='".$_SERVER['HTTP_REFERER']."'>Return to register</a>";
This works pretty good,also,if the user puts in an invalid email address that gets past the
validator,they will be emailed the download link to the email address they entered,so they won't be getting anything from you. You may get a bounce back to your inbox.
Cheers.