D
D
Denis2016-10-08 10:39:27
PHP
Denis, 2016-10-08 10:39:27

Working with mail php?

The form sends a request from the user to the client's address, but the address from whom should be displayed specifically to him, but when I put his address in the mail, a letter comes from another mailbox: [email protected]
How to fix this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Filippenko, 2016-10-08
@alexfilus

www.php.su/mail

/* получатели */
$to= "Mary <[email protected]>" . ", " ; //обратите внимание на запятую
$to .= "Kelly <[email protected]>";

/* тема/subject */
$subject = "Birthday Reminders for August";

/* сообщение */
$message = '
<html>
<head>
 <title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
 <tr>
<th>Person</th><th>Day</th><th>Month</th><th>Year</th>
 </tr>
 <tr>
<td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
 </tr>
 <tr>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
 </tr>
</table>
</body>
</html>
';

/* Для отправки HTML-почты вы можете установить шапку Content-type. */
$headers= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

/* дополнительные шапки */
$headers .= "From: Birthday Reminder <[email protected]>\r\n";
$headers .= "Cc: [email protected]\r\n";
$headers .= "Bcc: [email protected]\r\n";

/* и теперь отправим из */
mail($to, $subject, $message, $headers);

Must be passed to headers From
$headers .= "From: Birthday Reminder <[email protected]>\r\n";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question