1
if(isset($_POST['submit'])) {
    $width = trim($_POST['fbrush-width']);
    $height = trim($_POST['fbrush-height']);
    $areaM = trim($_POST['areaM']);
    $color = trim($_POST['fbrush-color']);
    $glue = trim($_POST['fbrush-glue']);
    $cost = trim($_POST['cost']);
    $orient = trim($_POST['orient']);
    $sizeWidthSm= trim($_POST['sizeWidthSm']);
    $sizeHeightSm = trim($_POST['sizeHeightSm']);
    $offset = trim($_POST['offset']);
    $textureId = trim($_POST['textureId']);
    $filtersMask = trim($_POST['filtersMask']);
    $costView= trim($_POST['costView']);
    $textureView = trim($_POST['textureView']);
    $stripsCountView = trim($_POST['stripsCountView']);
    $sname= trim($_POST['sname']);
    $fname = trim($_POST['fname']);
    $city = trim($_POST['city']);
    $email= trim($_POST['email']);
    $phone = trim($_POST['phone']);
    $comment = trim($_POST['comment']);
     $paytype = trim($_POST['paytype']);
      $paytype2 = trim($_POST['foto']);
     $textureView = trim($_POST['textureView']); 
 $file_name='5.png';    

     if ($textureId == 2) { $textureId =  "песок";} elseif ($textureId == 3) { $textureId =  "пыль";} elseif ($textureId == 4) { $textureId =  "мел";}
elseif ($textureId == 5) { $textureId =  "холст";} elseif ($textureId == 6) { $textureId =  "тонкий холст";}


    //Если ошибок нет, отправить email
    if(!isset($hasError)) {
$emailTo = '[email protected]'; //Сюда введите Ваш email

$body = "Ширина: $width \n\Высота: $height \n\Не знаю: $areaM \n\Цвет:\n $color \n\НЕ знаю:  $textureView \n\Цена $cost \n\не знаю $orient 
\n\см $sizeWidthSm \n\ширина $sizeHeightSm \n\что то $offset \n\текстуры $textureId \n\Маска $filtersMask
 \n\Цена $costView \n\Текстура2 $textureView \n\Что то $stripsCountView \n\что то $stripsCountView
\n\имя $sname \n\фамилия $fname \n\город $city \n\почта $email \n\телефон $phone \n\комментарий $comment \n\Оплата  $paytype 
"; 

$headers = 'From: My Site <'.$emailTo.'>' . "\r\n" . 'Reply-To: ' . $email;

        mail($emailTo, $subject, $body, $headers);
        $emailSent = true;
    }
}
1
  • Постарайтесь писать более развернутые вопросы. Поясните, в чем именно вы видите проблему, как её воспроизвести, что вы хотите получить в результате и т. д. 23 ноя 2015 в 12:40

2 ответа 2

1

Поддерживаю @Daniel, так же вы можете отдельно аттачем подцепить не только картинку, но и другой файл(rar,zip, doc, xls и тд). Зависит от того, что вы хотите получить.

0

Электронные письма поддерживают все те же теги html. То есть, чтобы прикрепить картинку, добавьте в $body:

<img src="...">

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.