I’m using the below code to submit form information to my email account but I also want it to send a confirmation email to the user. I like to add this message for automatic email-response `
Thanks for your interest “name of the sender”!
This is just a quick note to let you know we have received your form and will respond as soon as we can.
Best,
Marvin
` can you check my code how could I add the auto email-response code and execute it well?
<?php
header('Content-type: application/json');
$status = array(
'type' => 'success',
'message' => 'Application Sent!'
);
$name = @trim(stripslashes($_POST['name']));
$address = @trim(stripslashes($_POST['address']));
$email = @trim(stripslashes($_POST['email']));
$mobile = @trim(stripslashes($_POST['mobile']));
$email_form = $email;
$email_to = 'mrvn.acosta@gmail.com';
$body = '[name]' . $name . "\n\n" .
'[address]' . $address . "\n\n" .
'[email]' . $email . "\n\n" .
'[mobile]' . $mobile;
mb_language("Japanese");
mb_internal_encoding("UTF-8");
$success = mb_send_mail($email_to, 'Application', $body, 'From: <'.$email_from.'>');
echo json_encode($status);
die; ?>
there is no problem with this code, I just like insert the auto-response message to the user/ client for the confirmation email when the form is successfully sent.