Skip to content
Sign upLog in
← Back to Community

Why won't the php mail() function work?

Profile icon
TSelden

The mail() function for PHP doesn't seem to work. No matter what I try. I can't figure out why. Does anybody know? Thanks in advance!

Answered by Baconman321 [earned 5 cycles]
View Answer
Voters
Profile icon
AhmedHasan3
Profile icon
LeoXu2
Profile icon
TSelden
Comments
hotnewtop
Profile icon
TSelden

It gives me this error as well (in an alternative editor): sh: 1: /usr/sbin/sendmail: not found. I think this means that the sendmail package isn't installed. I think that I need to install the sendmail package, although I don't know how to do that on repl.it, and I'm not currently in a position where I can download another editor.

Profile icon
Baconman321

@TSelden
I have gotten this in my project, and it's because they either turned that option off in the php.ini file or blocked you from downloading. I have tried to download the package and it says you don't have root, so whoever set this up didn't add this. You can request this on feedback (https://repl.it/feedback). I tried using Node.js to mail (it works!). If this answers your question please mark it as the answer.

Profile icon
TSelden

@Baconman321
Okay. Thank you!

Profile icon
Baconman321

@TSelden
No problem! Hard to find a person like you who uses PHP as well as me these days! Keep on being great!

Profile icon
[deleted]

I also do PHP and I would like to know how to make an emailer with [email protected]