codeignater邮件功能在共享主机服务器上不起作用

时间:2019-10-18 06:41:37

标签: php codeigniter hosting sendmail

$this->load->library('email');
//Email content
$htmlContent = '<h1>Don`t worry, we all forget sometimes </h1>';
$htmlContent .= '<p>Hi,</p>';
$htmlContent .= '<p>You`ve recently asked to reset the password for this account</p>';
$htmlContent .= '<span>Your Forgot Otp Is :</span>';
$this->email->to($email);
$this->email->from('abc@gmail.com','abc');
$this->email->subject('Forget Password');
$this->email->message("$htmlContent"." "."<p><h2>$forgotOtp</h2></p>"."<p>Thanks,</p>"."<p>Team</p>"." "." <p> abc<p>");
          //Send email
$this->email->send();

$this->ApiModel->UpdateForgotOtp($email,$forgotOtp);
print_r(json_encode([
        'message'=>'success',
       'status'=>200
]));

此代码在共享主机服务器上不起作用。不会显示错误消息

1 个答案:

答案 0 :(得分:0)

首先,您需要设置配置以发送电子邮件,

$( 'input[name="idCateg[]"]' ).on( 'click', function() {
    // Check if there are children checked
    var has_child = false;
    $( this ).closest( '.child' ).children( 'input' ).each( function() {
        if( this.value == true ) {
            has_child = true;
        }
    } );

    // set the parent checkbox after check the children
    if( has_child == true ) {
        $( this ).closest( '.child' ).prevAll( 'tr.parent:first' ).find( 'input' ).val( true );
    } else {
        $( this ).closest( '.child' ).prevAll( 'tr.parent:first' ).find( 'input' ).val( false );
    }
} );