L
L
Leonid Rozhentsev2021-03-26 14:05:03
PHP
Leonid Rozhentsev, 2021-03-26 14:05:03

What to do when submitting a form?

There is a PHP script for sending data from a form to mail using PHPMailer. There are lines in the code:

$mail->isSMTP();                                    
$mail->Host = 'smtp.gmail.com'; 
$mail->SMTPAuth = true;  
$mail->Username = '';  
$mail->Password = '';                  
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;

In 4-5 lines, you need to specify the login and password for the mailbox from which letters should be sent. And then the question is: what kind of box should this be? For example, I'm making a landing page for a customer with a feedback form and this script. What to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Danny Arty, 2021-03-26
@RLeo777

In 4-5 lines, you need to specify the login and password for the mailbox from which letters should be sent. And then the question is: what kind of box should this be? For example, I'm making a landing page for a customer with a feedback form and this script. What to do?

Well SMTP at you is gmail specified. Specify just the mail and password from the gmail box from which letters will be sent. Conditionally:
$mail->isSMTP();                                    
$mail->Host = 'smtp.gmail.com'; 
$mail->SMTPAuth = true;  
$mail->Username = 'мояпочта@gmail.com';  
$mail->Password = 'парольОтМоейПочты';                  
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;

If there is an error when sending, then turn off two-factor authentication

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question