0
///// Send Email To HR Function /////
function sendEmailToHR($pdf, $resume, $enquirydata){

$emailbody .='<h1>Employment Application from ' . $enquirydata['First Name'] . ' ' .         $enquirydata['Last Name'] . '</h1>';

foreach ($enquirydata as $title => $data){
    if(!empty($title) && !empty($data)){
         $emailbody.= '<strong>' . $title . ': </strong>' . $data .'<br>';   
    }
}
//////Mail Server Settings then second email
if (isset($_REQUEST['email'])){
    $fname = $_REQUEST['fname'];
    $lname = $_REQUEST['lname'];   
$email = $_REQUEST['email'];

$to = $email;
$respond_message = "message"
mail($email, $subject, $respond_message);

///// Mail Server settings for second email I am using a concatenated string to hold in a temporary location the items submitted in the HTML form.

  • I am not providing the full code (I have removed mail server setting information, but it is included in my php).... I am really just trying to figure out why this form successfully sends an html email, with two PDF attachments (one uploaded by the form submitter) and will not send the follow up automated email. – Sun City Roseville Jul 29 '22 at 22:22
  • Sorry it's not clear where the emails are being sent. Only one email seems to be sent from the code you've shown. But there are several places where you seem to have used backticks instead of single quotes around your strings. That will not do any good...correct those and try it again. – ADyson Jul 29 '22 at 22:31
  • I corrected the backticks, to show correct in the example. It is also not showing that after the mail($email) is where I have the server information located a second time for the second email – Sun City Roseville Jul 29 '22 at 22:44
  • So you've only shown us the code of the first email, and not the second one where the problem is, is that correct? – ADyson Jul 29 '22 at 22:48
  • No the code for the second email is after the notation ///// Mail server settings then second email – Sun City Roseville Jul 29 '22 at 23:03
  • ////////####### Send Email To HR Function #######//////// function sendEmailToHR($pdf, $resume, $enquirydata){ $emailbody .='

    SCR Employment Application from ' . $enquirydata['First Name'] . ' ' . $enquirydata['Last Name'] . '

    '; foreach ($enquirydata as $title => $data){ if(!empty($title) && !empty($data)){ $emailbody.= '' . $title . ': ' . $data .'
    '; } } /// then mail server settings
    – Sun City Roseville Jul 29 '22 at 23:05
  • // Send the applicant response using the mail () function // if (isset($_REQUEST['email'])){ $fname = $_REQUEST['fname']; $lname = $_REQUEST['lname']; $email = $_REQUEST['email']; $to = $email; //Prepare autoresponder message// $respond_message = "message" mail($email, $subject, $respond_message); } ////then mail server settings – Sun City Roseville Jul 29 '22 at 23:06
  • As you can hopefully see for yourself that is unreadable. Code does not belong in the comments section (except for tiny snippets) Please [edit] your question when you need to show more information like this. Thanks. – ADyson Jul 29 '22 at 23:23
  • Although it seems to be the same as what you showed already anyway?? Nonetheless we can't see the email code which sends successfully, so we have nothing to compare it to. Generally if youre having problems sending email from php you need to read the main answer on this post thoroughly: [PHP mail function doesn't complete sending of e-mail](https://stackoverflow.com/questions/24644436/php-mail-function-doesnt-complete-sending-of-e-mail) – ADyson Jul 29 '22 at 23:27

0 Answers0