Thank you soo much this helped me figure out handle change!
@shadow_32134 жыл бұрын
Brilliant! Thank's a lot !!
@tiagoduarte54234 жыл бұрын
What if i want to use POST instead of GET? Thank you for the tutorial, it's pretty awsome!
@VicodeMedia4 жыл бұрын
Just change the method in your React.js App from /src/components/Form.js line 33. Click here to see it: github.com/ruvictor/send-email-with-react/blob/master/src/components/Form.js#L33 In this case you will have to change your PHP file from your API server as well.
@BrianArtea3 жыл бұрын
Thank you for the tutorial! Once I run npm run build and put the files from the build folder in the directory where do I put the php file?
@VicodeMedia3 жыл бұрын
The php files can be on the same server but different folder or on a subdomain so you will have a separate url kinda thing. Your react form needs an API url to send the data to.
@BrianArtea3 жыл бұрын
@@VicodeMedia in index.php what do put in where their is for url: if($_SERVER['HTTP_REFERER'] === "localhost:3000/") Also this would go in the same folder on shared hosting: require 'vendor/autoload.php';, A video on putting the form and all to shared hosting would be awesome!
@deepikabogati7614 жыл бұрын
thankyou for tutorial but do we need server to make this code work?
@VicodeMedia4 жыл бұрын
You need to send an email and you can't do that with React only. You need a server to send emails.
@deepikabogati7614 жыл бұрын
@@VicodeMedia ohh thankyou so much for quick response
@aogunnaike4 жыл бұрын
Great job, how about PHP and nodejs combined
@MissAcelya2 жыл бұрын
hello, thank you for tutorial, may i ask if it is secure to upload index.php file with password is written inside ?
@VicodeMedia2 жыл бұрын
Yes it's safe. Nobody can see your php code.
@karimnatakarim59724 жыл бұрын
Hello thank you for tutotial ? Do you know to work in Node.js maybe ?
@VicodeMedia4 жыл бұрын
Why are you asking, Karim? Do you want to build the server side with Node?
@DiDarkZone4 жыл бұрын
How to deploy it now?
@VicodeMedia4 жыл бұрын
From the command line: "npm run build"
@DiDarkZone4 жыл бұрын
@@VicodeMedia Yeah i did this,its isnt working. I have to remove index.php to the main folder or how? When i do 'npm run build' to the project ,it works fine.But when i remove my index.php and vendor folder to my server I got white clean screen.
@VicodeMedia4 жыл бұрын
You should host the api on a public domain or subdomain.
@DiDarkZone4 жыл бұрын
Maybe you know service of free domain
@VicodeMedia4 жыл бұрын
I think GoDaddy had some hosting deals with free domain
@tod6703 жыл бұрын
does this work for hotmail?
@VicodeMedia3 жыл бұрын
I am not sure but you can use this libraries with different other SMTP servers.
@mattinurminen30154 жыл бұрын
Hi! How resolve CORS error?
@VicodeMedia4 жыл бұрын
Add the header in your php file
@mattinurminen30154 жыл бұрын
@@VicodeMedia It isn't work
@sandibaeva523 жыл бұрын
I am also getting this error. How did you solve it? adding headers didn't work for me
@Ilirshala73 жыл бұрын
How to get my personal api?
@VicodeMedia3 жыл бұрын
Hi! Can you be more explicit about what you mean by personal API?
@Ilirshala73 жыл бұрын
You used api/..../ how can i use a free api for sending ?