Answer the question
In order to leave comments, you need to log in
Attach file in php mail?
Good afternoon. There is a problem. It is necessary that after entering the user's email, a price list is sent to his email.
The code itself is there, but I don’t understand how to attach the file
<?php
//проверяем, существуют ли переменные в массиве POST
if(!isset($_POST['email'])){
?> <form action="send.php" method="post">
<input type="text" name="email" placeholder="Укажите e-mail" required>
<input type="submit" value="Отправить">
</form> <?php
} else {
$email = $_POST['email'];
$email = htmlspecialchars($email);
$email = urldecode($email);
$email = trim($email);
if (mail("$email", "Прайс лист с сайта автомойки", "Прайс лист для: ".$email ," \r\n")){
echo "Прайс успешно отправлен";
} else {
echo "При отправке прайса возникли ошибки";
}
}
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question