Page 1 of 1

NMS error not submitting emails

Posted: Sat Feb 04, 2006 9:36 pm
by jbogard
I am getting the following error - running windows 2003 PHP 5 Mysql 5
Using CMSMailer SMTP Have set everything up as instructed in both NMS and CMSMailer

Everything else I have installed runs great except this :(

http://www.blueleafgraphics.com/index.p ... EWSLETTERS


PHP Fatal error: Call to undefined function: checkdnsrr() in d:\home\hnt20a098\modules\NMS\NMS.module.php on line 1588



/* ------------------
HELPER FUNCTIONS
------------------ */
function check_email_mx($email) {
if( ((preg_match('/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/', $email)) ||
(preg_match('/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/',$email))) && strlen($email) > 5 ) {
$host = explode('@', $email);
//disabled here because windows machines can't use checkdnsrr.
if (strrpos(strtolower($_SERVER['SERVER_SOFTWARE']), "win") === true){
return true;
}else{
Line 1588------------------ if(checkdnsrr($host[1].'.', 'MX') ) return true;
if(checkdnsrr($host[1].'.', 'A') ) return true;
  if(checkdnsrr($host[1].'.', 'CNAME') ) return true;
}
}
return false;
}

Re: NMS error not submitting emails

Posted: Sat Feb 04, 2006 11:25 pm
by calguy1000
Note, not all servers return something containing "win" in the "SERVER_SOFTARE" field.  others return "Microsoft IIS" or some such thing.

It may be better to either abort this function, and always return true, or to use one of the freeware replacements available on php.net, etc.