I can not find a solution on the Internet, I suspect that I can not make a competent request. The essence is this: the client enters the name, email; I send them ajax to a php handler, send a letter to the client to the entered email, there are no problems with this, but I don’t mind how to attach a file to this letter (pdf, doc ..).
<? $name = $_POST['name']; $phone = $_POST['phone']; $email = $_POST['email']; if ($name == "" || $phone == "" || $email == "" ) { echo "Заполните все поля"; die(); } $email = strtolower($email); $to = $email; $subject = 'Каталог'; $message = ' <html> <head> <title>'.$subject.'</title> </head> <body> <p>'. $name .', доброго времени суток. Высылаем Вам каталог.</p> </body> </html> '; $headers = "Content-type: text/html; charset=utf-8 \r\n"; $headers .= "From: Отправитель". $email ."<". $email .">\r\n"; mail($to, $subject, $message, $headers); ?>