Password reminders / Emails not being sent

12 posts by 2 authors in: Forums > CMS Builder
Last Post: January 25, 2013   (RSS)

By dm - January 17, 2013 - edited: January 17, 2013

hi,

we have an issue with email on our cmsbuilder/server.

we are not receiving emails via the admin password reminder page and the alert admin login plugin which works with the membership plugin also isn't sending mail so i guess i have a bad setting somewhere.

my admin email address uses the same domain as the cms installation.

can anyone give me some hints on where to look to try and resolve this issue.

as far as i can see i have the admin email / server paths etc set up correctly in the general settings but no mail is being sent.

many thanks for you help!

By gregThomas - January 17, 2013

Hi,

Which version of CMS Builder are you using? If it's 2.17 or 2.50 I would enable mail loggin under general settings, and then check the outgoing mail section to see if CMS Builder is trying to send mail. If it is, it's most likely a server issue. 

Has this suddenly started happening? Or have you changed anything recently, eg upgraded CMS Builder or upgraded a plugin.

One of the first things I would check is the $emailHeaders array on your user password request page. You could use the showme function to output its content:

showme($emailHeaders); 

This will allow you to check that everything looks correct , e.g, no missing e-mail addresses or incorrect file paths. 

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By dm - January 17, 2013

hi greg

thanks for the help, this is a fresh installation of 2.50 using the membership plugin and admin login alert (i disabled these and had the same issue)

i just set up mail logging and cms builder indeed trying to send out the mail (it leaves a copy of the mail in ougoing)... so i guess its a server issue but not sure where to start?

any tips on where to start on this would be greatly appreciated

many thanks

elliot

By gregThomas - January 17, 2013

Hi Elliot,

The first thing I would check is that the e-mails you are sending arn't appearing in your spam folder. 

If they arn't appearing in your spam folder I would create a really basic e-mail script to see if the PHP mail function on your server is working correctly. I would try the examples on this page:

http://php.net/manual/en/function.mail.php

If these arn't working, I would contact your hosting company and give them a URL/file path to your email test script.

Let me know if you have any questions, and how the testing goes.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By dm - January 18, 2013 - edited: January 18, 2013

hi greg

cheers for the info, nothing is going to spam so i set up a test email script which i have working on another site on the same hosting companies servers and it is not working here.

i should have tested that out first before coming here! sorry!

also just checked cmsbuilder install on this other site and the strange thing is even though the email script is working the cms installation password reminder on that site isn't working either (it had never been used so never noticed the error)

so kind of double confused now!

hopefully the hosting company will get back to me soon with fix and i can carry on developing the site..

many thanks for your help!

By dm - January 25, 2013

hi greg

we have had such a poor week with our webhost that we have jumped ship and set up somewhere new!

this has sorted the issue with the cms password reset not working and as per your advice i also have a basic mail script working fine no problems...

the alertAdminLogin plugin still doesnt seem to want to send any mail alerts out though...

do you know of any reason why this would not be working?

has anyone else here has experienced any problems using this plugin with 2.50?

would be nice to confirm the problem isn't between the pc and the chair!

many thanks for your help!

By gregThomas - January 25, 2013

Hi,

Good to hear things are sorted with your hosting.

If the plug-in is activated and you have entered a valid e-mail address in the general settings,  I can't see anything that would stop it from working. I had a look at the plug-in code and it might be something to do with the mail function. I did a quick edit to the plug-in to use the CMS Builder sendMessage function instead, which has the benefit of logging messages if you have CMS Builder set up for that, this might help with finding the problem. I've attached a copy of it to this post. 

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com
Attachments:

alertadminlogin_003.php 2K

By dm - January 25, 2013

thanks for taking a look greg!

your attached plugin here seems to be identical to the original plugin file?

By gregThomas - January 25, 2013

I've checked, and it looks to me as if my changes have been uploaded. You should see these changes starting at line 42 of the attached file:

//$mailResult = @mail($to, $subject, $message, "From: {$SETTINGS['adminEmail']}");

$mailResult = sendMessage(array(
  'from' => $SETTINGS['adminEmail'],
  'to' => $to,
  'subject' => $subject,
  'text' => $message
));

Greg Thomas







PHP Programmer - interactivetools.com