nitation Posted June 8, 2008 Share Posted June 8, 2008 Hello Guys, I have a form script that send an email to a user after a successful signup. What am actually trying to do is to send an email attachment together with the email. The confirmation email is fine, but how do i attach the attachment together. Please how can this be done. Have a look at my script. <?php include("connect.php"); include("includes/en.php"); $tabsubmit=true; $oktab=false; $msg="Apply for an account"; if($sub){ $sqlcheckemail=mysql_query("select email from register_account where email='$email'"); if(!empty($sqlcheckemail)){ $numemail=mysql_num_rows($sqlcheckemail); } $sqlcheckuserid=mysql_query("select userid from register_account where userid='$userid'"); if(!empty($sqlcheckuserid)){ $numuserid=mysql_num_rows($sqlcheckuserid); } if(empty($firstname)){ $msg='The firstname field is empty'; } if(empty($lastname)){ $msg='The Surname field is empty'; } if(empty($occupation)){ $msg='The Occupation field is empty'; } if(empty($DD)){ $msg='The Day field is empty'; } if(empty($MM)){ $msg='The Month field is empty'; } if(empty($YYYY)){ $msg='The Year field is empty'; } if(empty($hometel)){ $msg='The Home Telephone is empty'; } if(empty($tel)){ $msg='The Telephone field is empty'; } if(empty($email)){ $msg='The Email is empty'; } if(empty($house)){ $msg='The House Number is empty'; } if(empty($address)){ $msg='The address field is empty'; } if(empty($zip)){ $msg='The Post code field is empty'; } if(empty($userid)){ $msg='The Login Id field is empty'; } if(empty($pin)){ $msg='The Password field is empty'; } if(empty($pin2)){ $msg='The confirm pin field is empty'; } if($numemail==1){ $msg='Email is in use by another person'; } if($numuserid==1){ $msg='Login id is in use by another person'; } if($pin!=$pin2){ $msg='Both PINs doesn\'t Match'; } if(!preg_match("/@/",$email)){ $msg='Please include @ symbol in the email field'; } else if(($email) && ($pin=$pin2) && ($userid) && ($firstname) && ($lastname) && ($title) && ($address) && ($house) && ($zip) && ($DD) && ($MM) && ($YYYY) && ($hometel) && ($tel) && ($occupation)&& ($numemail==0) && ($numuserid==0) && (preg_match("/@/",$email)) ){ $sqlsub=mysql_query("insert into register_account(title,lastname,pin,email,firstname,occupation,gender,DD,MM,YYYY,address,marital,hometel,tel,zip,house,country,account_type,currency_type,userid,adddate,status,status_button)values('$title','$lastname','$pin','$email','$firstname','$occupation','$gender','$DD','$MM','$YYYY','$address','$marital','$hometel','$tel','$zip','$house','$country','$account_type','$currency_type','$userid',NOW(),'$status','$status_button')"); } if($sqlsub){ $msg=$Reg_Succ_MSG; $tabsubmit=false; $oktab=true; $mailmsg="$hello $title $lastname $firstname\n\n$Reg_Mail_MSG\n\n$Reg_Below_Mail\nAccount Type: $account_type\nLogin Id: $userid\nAccount Pin: $pin\nEmail: $email\nLocation: $country\n\n$our_team\n\n$host\n$disclaim\n\n$copyright"; $send_mail= mail ($email,$Reg_Mail_subject,$mailmsg, "From: $adminmail"); } } ?> Quote Link to comment Share on other sites More sharing options...
nitation Posted June 8, 2008 Author Share Posted June 8, 2008 is my question too boring to be attended to. Please someone should help!!! Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted June 8, 2008 Share Posted June 8, 2008 Why on earth should someone help? People aren't paid to help you know. No doubt you've extensively googled the subject and couldn't find anything. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.