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 sender. I like to add this message for automatic 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 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 = '[email protected]';
$body = '[name]' . $name . "
" .
'[address]' . $address . "
" .
'[email]' . $email . "
" .
'[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 recoding for the auto-responding email when this form is successfully sent.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…