Hello. I am in html-letters at the level of ... zero, approximately. Never dealt with them. And then they set the task - to make the manager from the admin panel send them by one click. Those. make a template, by clicking on the "send" insert data from the form there and send it to a known email address

Everything would be fine, but I do not quite understand how the system works at all. Well, I will write like this ... and what will come to the recipient? Html file or expanded letter? And what will happen in this particular case with the display of pictures? In runet, I saw little information and basically it is old.

I would be very grateful for the advice :)

  • So they would write and send it to the post office, and if there were problems, then they would ask. And it turns out you did not even try, but you ask) - DaVASrK
  • It will take a lot of time, after all. And I really do not quite understand how the entire departure mechanism works, what exactly will send POST, ... Therefore, I wanted not to reinvent the old bicycle, but ask for clarification, or perhaps a reference to them. Although I really found a little on the departure. But everyone learns how to impose) - Krasnodaretc

1 answer 1

I understand you perfectly well this is a painful question for a newbie and I myself was in a similar stupor. I answer:

The form tag must have the attributes action = "" and method = "post" - this is how to give data

in the receiving php script to catch the data sent from the form use the global variable $ _POST, only in the form fields do not forget about the name = "" fields and to send the data to anyone use the mail () function - everything I noticed - you You can find in reference books if there are gaps. In other words, if you just need to send yourself an email, use the mail () function. If you need to display what entered into the form use $ _POST in the receiving form. If separately snag, then do not go to a merger, until you figure out each of these moments.

further mail (); it is better not to use, but go to the smtp client - since google gmail no longer accepts email sent by the mail () function;