我的If语句在以下用于发送电子邮件的代码中不起作用,如何解决if语句?

时间:2018-08-22 00:16:25

标签: php mysql

当我有新数据或任何更新时,我将下面的代码写为事件,下面的代码将运行。 这段代码有效,但是问题是无论“ PN”或“ diff”的值如何,“ if”都不起作用,并且是否发生了任何更新

这是我的代码: 我将不胜感激。

/**
 * Send a simple email
 */

// Email parameters
{date1}={Certificate Date};
{date2}=date("Y-m-d");
$date1Timestamp = strtotime($date1);
$date2Timestamp = strtotime($date2);
{diff}=($date2Timestamp - $date1Timestamp);
$diff={diff};
$PN2={Project Number};
$PN = substr($PN2, 0, 1);
$mail_smtp_server    = '192.168.1.251';        // SMTP server name or IP address
$mail_smtp_user      = 'noreply';                   // SMTP user name
$mail_smtp_pass      = '12741274';                // SMTP password
$mail_from           = 'noreply@test.com';          // From email
$mail_to                ='kiarash.moshar@test.com';         // To email 
$mail_subject        ={Project Number};     // Message subject
$mail_message        = 'Hello ,
Date diff: '.{diff}.'
Please check Database Website on http://192.168.1.231:8091application_Login
You can find ENR Tab in Lab Support.
(Email Sender Application in under developing)

Best wishes,'; // Message body
$mail_format         = 'T';                       // Message format: (T)ext or (H)tml
$mail_copies         = '';                        // List of the emails that will recieve the message
$mail_tp_copies      = '';                        // Type copies: BCC (Hiden copies) or CCC (Regular copies)
$mail_port           = '25';                     // Server port
$mail_tp_connection  = 'N';                       // Connection security (S) or (N)

// Send email";
if((($diff)/86400)>125 && $PN="BI")
    {
        sc_mail_send($mail_smtp_server,
                     $mail_smtp_user,
                     $mail_smtp_pass,
                     $mail_from,
                     $mail_to,
                     $mail_subject,
                     $mail_message,
                     $mail_format,
                     $mail_copies,
                     $mail_tp_copies,
                     $mail_port,
                     $mail_tp_connection);
    }

0 个答案:

没有答案