D
D
dez64ru2015-09-26 21:19:57
PHP
dez64ru, 2015-09-26 21:19:57

php mail text formatting?

How to send letters with formatted text to soap via mail?

<?php 
  if($_POST['submit']) {
  $phone = substr(htmlspecialchars(trim($_POST['phone'])), 0, 1000);
  $name = substr(htmlspecialchars(trim($_POST['name'])), 0, 1000);
  $message = "Телефон: ".$phone."
ФИО:".$name;
  mail('[email protected]', 'Новый заказ!', $message);
  }
  ?>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan, 2015-09-26
@dez64ru

$headers= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
mail($to, $subject, $message, $headers);

D
dez64ru, 2015-09-26
@dez64ru

Using bb codes or html tags does nothing. Come as text.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question