Sending email from next app with PHP
Unanswered
English Lop posted this in #help-forum
English LopOP
Hi, I'm about to make a website where I need to send an email from form. I saw many tutorials with nodemailer, but I don't really want to put email password even into .env. I heard that php can also be used, but I couldn't find any guide for it. Can someone please help me with that?
I tried putting a php file either into /public or try to send a post req to /api, but I got either 404 or 405. The PHP file itself should work, because I used it some time ago in basic HTML + php project.
I tried putting a php file either into /public or try to send a post req to /api, but I got either 404 or 405. The PHP file itself should work, because I used it some time ago in basic HTML + php project.
3 Replies
Pacific sand lance
if u want to run php u need php interpreter, doesnt really matter whether u put it inside public dir or no
also in php u still need to provide mail credentials
@Pacific sand lance also in php u still need to provide mail credentials
English LopOP
okay thanks, I eventually got it by putting php file into public and exporting it via npm run build