Can't send mail by PHP

Status
Not open for further replies.

dbsscout

New Member
Messages
1
Reaction score
0
Points
0
Originally, when i used dokuwiki, it can not send email

After that, i tried the following script..
it printed "Message not sent!!!"..
i wonder what the problem is..

thanks

<?php
$to = "my_email@gmail.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com";
$headers = "From: $from";
echo (mail($to,$subject,$message,$headers)) ? 'Message sent!!!' : 'Message not sent!!!';

?>
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
What happens if you actually set $from to a valid email? We have spam prevention measures in place that may very well be blocking that since its not an email set on our servers.
 
Status
Not open for further replies.
Top