Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
2

PHP Mail not working

Coder543
Coder543

PHP mail() does not seem to be working in repl.it and i have tried it in two repls. I would appreciate help as I have looked over the internet and I am a beginner to PHP. Repl.it error: sh: 1: /usr/sbin/sendmail: not found.
https://repl.it/@Coder543/PHP2#index.php
https://repl.it/@Coder543/PHP1#index.php

2 years ago
You are viewing a single comment. View All
2
PattanAhmed
PattanAhmed

@Coder543
Hi again,
Check this code:-

<?php $to = '[email protected]'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?>

Check this website for more methods (scroll down to see the methods) to send e-mails from PHP
Go from here

Hope this helps
Please mark my answer if this helps

2 years ago