I am trying to compile mail.php so that it sends the image attached to the HTML letter (not attached, but attached) with a link to the page of the site. Something like an E-card should work out, sending photo postcards through the form. Now I stopped at this ... if anyone has any ideas, write.

<?php $post = (!empty($_POST)) ? true : false; if($post) { $photo = $_POST['photo']; /// ссылка на изображение $url = $_POST['url']; /// ссылка на страницу $address = $_POST['address']; $message = $_POST['message']; $error = ''; if(!$address) {$error .= 'Укажите электронную почту. ';} if(!$message || strlen($message) < 1) {$error .= 'Введите сообщение. ';} if(!$error) { $email = $_POST['email']; $email = "email@Photo-card.com"; $sub = "Theme photo-card"; $mes = "Тема: " .$sub."\n\nСообщение: ".$message."\n\n"; $send = mail ($address,$sub,$mes,"Content-type:text/plain; charset = UTF-8\r\nFrom:$email"); if($send) {echo 'OK';} } else {echo '<div class="err">'.$error.'</div>';} } ?> 

  • one
    read at least the documentation - Naumov
  • it makes no sense to delve into what you need once)))) it's probably easier to ask here - Kenno
  • Easier to set the task for a freelancer. The spirit of this community is not to ask for a turnkey solution, or decide for yourself. And to deepen their knowledge in programming, find the best solution, learn new things ... Here, answering people do not earn a reputation, but reinforce their knowledge, and people who ask questions they learn. Here is where the controversy breaks out and the debate about which solution is better, the truth is born here. This community is not “free freelance” because there is a good Russian saying “you can’t easily pull a fish out of the pond” - Naumov
  • no one argues - Kenno
  • I can only advise you to skip to the side of the header in particular the Content-type and how to send an email in html format. - Naumov

0