M
M
max_bu2017-09-10 22:06:35
PHP
max_bu, 2017-09-10 22:06:35

Sending vuejs form data to mail via php?

Hello, tell me please.
You need to send an application to the mail from the form.
What is the right and easiest way to do this?
I got into axios, it sends data to send.php which should process it. The data leaves, and the handler does not send further. How to organize all this correctly? It is in the vue + php bundle.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2017-09-11
@boratsagdiev

Where is the PHP file? If you are testing on a localhost, then, as far as I remember, assemblies like Denwer / Openserver, by default, cannot send letters, but Openserver stores them somewhere in the tmp/sendmail server folder.

V
Vitaly, 2018-07-11
@daruvayc0

Probably no longer relevant, but maybe it will help someone. Try to get the raw Post data like this, this should be done if you are passing data in Json format.

$inputJSON = file_get_contents('php://input');
$input = json_decode($inputJSON, TRUE);

$name = $input['name'];
$email = $input['email'];

$message = "Name: ".$name."\nEmail: ".$email;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question