Jump to content

maddtechwf

New Members
  • Posts

    8
  • Joined

  • Last visited

maddtechwf's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi Tryingtolearn, I really appreciate the code above. I'm trying to modify the last part of the code to only add an email recipient if it's outside of the start and end time and only on Saturday and Sunday. This is what I came up with. $offDays = array('Sunday', 'Saturday'); //Business Hours $date = date_create(date('Y-m-d')); $setNow = date_time_set($date, date('H'),date('i'),date('s')); $nowTime = date_format($setNow, 'Y-m-d H:i:s'); $setStart = date_time_set($date, 6, 0, 0); $startTime = date_format($setStart, 'Y-m-d H:i:s'); $setStop = date_time_set($date, 17, 0, 0); $stopTime = date_format($setStop, 'Y-m-d H:i:s'); if(($nowTime < $startTime && $nowTime > $stopTime) OR (in_array(date('l'), $offDays)) { $mail->addAddress('my.name@mysite.com', 'My Name'); }
  2. I tried to rewrite it just now. Was hoping someone could tell me if this logic will work. if(date("l") == Saturday) OR (date("l") == Sunday)) // Runs if it's Saturday or Sunday { $mail->addAddress('name@mystime.com', 'My Name'); } else { if((date("H") < 6) OR (date("H") > 17)) //Checks if before 6AM or after 5PM { $mail->addAddress('name@mysite.com', 'My Name'); } }
  3. I'm using PHPMailer and it works great. The only issue I'm having is that I need to add an extra recipient back on the time of day and whether it's the weekend. Currently I'm using: if((date("G") < 6) OR (date("G") > 17) OR (date("N") === 6) OR (date("N") === 7)) { $mail->addAddress('name@mysite.com', 'My Name'); } I need to add this person if it's before 6AM or after 5PM during the week and any time on Saturday and Sunday. Can anyone help me with this logic?
  4. Found my issue. I'm on PHP 5.5.X and the drivers with Version 3 only support up to 5.4. If you need to run sqlsrv with PHP 5.5.x then you need to head over to this article and download the appropriate DLL's. http://social.msdn.microsoft.com/Forums/sqlserver/en-US/e1d37219-88a3-46b2-a421-73bfa33fe433/unofficial-php-55-drivers-x86
  5. Okay, Here is an update on the situation. I've added these two dll's to my ./ext folder. I've then gone into php.ini and added them as extensions. I'm running PHP 5.5.14. I want to also note that the ldap.dll is loading just fine in my PHPinfo page. extension=php_pdo_sqlsrv_54_nts.dll extension=php_sqlsrv_54_nts.dll extension=php_ldap.dll ;extension=php_bz2.dll ;extension=php_curl.dll ;extension=php_fileinfo.dll ;extension=php_gd2.dll ;extension=php_gettext.dll ;extension=php_gmp.dll ;extension=php_intl.dll ;extension=php_imap.dll ;extension=php_interbase.dll ;extension=php_mbstring.dll ;extension=php_exif.dll ; Must be after mbstring as it depends on it ;extension=php_mysql.dll ;extension=php_mysqli.dll ;extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client ;extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client ;extension=php_openssl.dll ;extension=php_pdo_firebird.dll ;extension=php_pdo_mysql.dll ;extension=php_pdo_oci.dll ;extension=php_pdo_odbc.dll ;extension=php_pdo_pgsql.dll ;extension=php_pdo_sqlite.dll ;extension=php_pgsql.dll ;extension=php_pspell.dll ;extension=php_shmop.dll ; The MIBS data available in the PHP distribution must be installed. ; See http://www.php.net/manual/en/snmp.installation.php ;extension=php_snmp.dll ;extension=php_soap.dll ;extension=php_sockets.dll ;extension=php_sqlite3.dll ;extension=php_sybase_ct.dll ;extension=php_tidy.dll ;extension=php_xmlrpc.dll ;extension=php_xsl.dll
  6. Thanks for the quick answer. Do I use TS or NTS?
  7. Can anyone tell me how I can find out which version of sqlsrv that I need to load to work with my IIS server and MSSQL server?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.