Hi,
Here is the script to send e-mails from the job application section of my website. The application form is on another page which posts the variables to this script.
The form has a file field which gives applicants the opportunity to attach a CV - The if and else is to detect whether the applicant has attached a CV and then to run the correct mail headers and mail body
I want the script to send one copy of the e-mail to the user ($recipient1) and one copy to me ($recipient2) - The problem is that for some reason $recipient2 is getting a duplicate copy but with no information, although the subject line is there. It appears that the second mail function is executing twice.
Could anyone explain this? - Thanks in advance
if($userfile_size > 0){
//Mail headers and body if applicant has attached CV
}else{
//Mail headers and body if applicant has not attached CV
}
$recipent1 = $user_email;
$recipient2 = "jobs@mycompany.com";
$subject = "Job Application from Website";
mail($recipient1,$subject,$mail_body,$mail_headers);
mail($recipient2,$subject,$mail_body,$mail_headers);