Hello,
The emailing a new password function for a user used to work on our server (managed server, not shared hosting). Now all of a sudden it doesn’t work. Or rather, no email is ever received and I never see an error anywhere.
I’ve looked through the forums and saw some posts that came close to what I’m looking for but didn’t quite give me enough info to go on. I’m relatively new to MODx.
Can someone point me in the right direction to see where I can find out if the email is actually being generated? I need to figure out if this is a MODx issue, a PHP config issue, a mail server issue, or a hosting provider issue. (so many potential points of failure!)
One common cause it that your host just turned off the mail() function.
You can try this code (in a snippet) with both a local and remote email address and see if the mail arrives. If not, it’s a problem with the host/server:
// ---------------- SEND MAIL FORM ----------------
// send e-mail to ...
$to="me@localhost";
// Your subject
$subject="Test";
// From
$header="from: your name <your email>";
// Your message
$message="Hello \r\n";
$message.="This is test\r\n";
$message.="Test again ";
// send email
$sentmail = mail($to,$subject,$message,$header);
// if your email succesfully sent
if($sentmail){
echo "Email Has Been Sent .";
}
else {
echo "Cannot Send Email ";
}
?>
You should be able to check the mail logs to see where things are going.
First, check your system settings (tools | configuration | user tab) to see what your e-mail address is set to. I think that’s used in the FROM field and the host may not like what it’s set to.
Looks like it was a sendmail configuration issue. There wasn’t a default email address setup for "from". We’re now receiving the emails.
Thanks for all of the help!
Glad you got it sorted.