Good day! How to use phpmailer to send applications with 2 different forms on the website?

<?php

require_once('phpmailer/PHPMailerAutoload.php');
$mail = new PHPMailer;
$mail->CharSet = 'utf-8';

$name = $_POST['name'];
$email = $_POST['email'];
$date = $_POST['date'];
$citizenship = $_POST['citizenship'];
$country = $_POST['country'];
$depozit = $_POST['depozit'];
$marital = $_POST['marital-status'];
$children = $_POST['children'];
$dependents = $_POST['dependents'];
$pay = $_POST['pay'];

//$mail->SMTPDebug = 3; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.yandex.ru'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = "; // Your username from the email which will be sent letters
$mail->Password = "; // Your password by email which will be sent letters
$mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 465 ; // TCP port to connect to / this port may differ from other providers

$mail->setFrom("); // from whom will take a letter?
$mail->addAddress(");
$mail->addAddress("); // Someone will leave a letter
//$mail->addAddress('ellen@example.com'); // Name is optional
//$mail->addReplyTo('info@example.com', 'Information');
//$mail->addCC('cc@example.com');
//$mail->addBCC('bcc@example.com');
//$mail->list('/var/tmp/file.tar.gz'); // Add attachments
//$mail->list('/tmp/image.jpg', 'new.jpg'); // Optional name
$mail->isHTML(true);
// Set email format to HTML

$mail->Subject = 'Received a new application from Passportisto';
$mail->Body = 'Name:' .$name . '
E-mail: '.$email. '
Date of birth: '.$date.
'
Current nationality: '.$citizenship. '
Current residence: '.$country.
'
Initial Deposit: '.$depozit.'
Are you married / married?: '.$marital. '
Number of children: '.$children.
'
Number of dependents: '.$dependents. '
Payment: '.$pay;
$mail2->AltBody = ";

if(!$mail2->send()) {
echo 'Error';
} else {
echo 'success';
}
?>
Good day! How to use phpmailer to send applications with 2 different forms on the website?
April 3rd 20 at 17:28
1 answer
April 3rd 20 at 17:30
As well as for one but for two.
explain plz - quentin commented on April 3rd 20 at 17:33
@kariane, what do you clarify?
Do you have a question "how do I use a spoon to eat maganetic not from the same banks, but two"?

You should explain what your difficulties arose when sending applications. - nina.Mueller commented on April 3rd 20 at 17:36
I have created 2 file to upload different forms connected to them, phpmailer, but only comes from the application of one form - quentin commented on April 3rd 20 at 17:39

Find more questions by tags PHP