+1 vote
by
Hello. You need to write a very simple feedback form from 2 fields (Name and Email), the data must be sent to the email address on the server @mail.ru or yandex .EN.

Notes:
1. The form will be tested and will be amended on the local server, and therefore from the local server of the mail should be sent.
2. If possible, would it be possible to implement sending data to 2 email addresses?

5 Answers

0 votes
by
 
Best answer
But seriously, to send mail is better not to use mail() directly, but to choose one of the libraries.

* If the local server on Linux - problems should not be, if under Windows, usually in Assembly WAMP add a sendmail stub. If you use a library - it can itself replace the plug, working with servers directly using sockets.
* Can be on 3 and 4
$s = function(){
$sa = ['mail.ru', 'yandex.ru'];
return $sa[array_rand($sa)];
}
mail('user@'.$s(), 'Subject', print_r($_POST, true));
mail('user@'.$s(), 'Subject', print_r($_POST, true));


<form method="POST" action=""><input name="name"/><input name="email" /></form>
+1 vote
by
The data taken from the form are written to the variable is sent to two mailboxes.
$name = 'Вася Пупкин';
$yandex = "mail@yandex.ru";
$mail = "mail@mail.ru";

mail("$yandex", "тема", "сообщение");
mail("$mail", "тема", "сообщение");
by
syntax PHP you all very bad
by
ipad is not to blame.
by
FanatPHP : writing with the ipad.
by
still wrong. variables in PHP are written without quotation marks.
by
FanatPHP : write it as if it is not very convenient :|
And so fixed.
+6 votes
by
You need to write a very simple feedback form from 2 fields

Write.
0 votes
by
phpmailer +smtp Google or Yandex. You can specify even 900 addresses where letters go with the shapes. And shape give post just. If that knock on v-smerti2014@ya.ru help interference, ready code ladies only for the money.
by
fu, pettiness smell
by
throw the finished code here then if not petty
+1 vote
by
Write code only for the money
...