Jump to content

[SOLVED] How can this be done?


nitation

Recommended Posts

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");
}
}
?>

 

Link to comment
https://forums.phpfreaks.com/topic/109233-solved-how-can-this-be-done/
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.