2016-07-19 13 views
1
ライブ

に私はこのSMTP電子メール私が住んで電子メールを送った私のプロジェクトが、そのショーで

致命的なエラーのようなエラーが発生しました

public function send_mail($to_email, $mail_subject, $mail_message, $attachment='') 
{ 

    $msg_body=' 
      <!DOCTYPE html> 
      <html> 
      <head> 
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
      <title>Test</title> 
      </head> 
      <body> 
      <table width="80%" border="0" style="" cellspacing="0" cellpadding="0" align="center"> 
      </table></body></html>'; 
    $config['protocol'] = 'smtp'; 
    $config['smtp_host'] = 'ssl://smtp.gmail.com'; 
    $config['smtp_port'] = '465'; 
    $config['smtp_timeout'] = '7'; 
    $config['smtp_user'] = '[email protected]'; 
    $config['smtp_pass'] = '[email protected]@'; 
    $config['charset'] = 'utf-8'; 
    $config['newline'] = "\r\n"; 
    $config['mailtype'] = 'html'; // or html 
    $config['validation'] = TRUE; // bool whether to validate email or not 
    $this->email->initialize($config); 
    $this->email->from('[email protected]', 'www.test.com'); 
    $this->email->subject('Email Test'); 
    $this->email->message('Testing the email class.'); 
    $this->email->send(); 
    echo $this->email->print_debugger(); 
    exit; 
} 

問題を送信しない:メンバ関数初期化するために呼び出し()内の非オブジェクト上の/ 私は細かい作業を初期化します。私のローカルサーバーでは正常に動作します。

   <div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> 

      <h4>A PHP Error was encountered</h4> 

      <p>Severity: Notice</p> 
      <p>Message: Undefined property: airport_mailer::$email</p> 
      <p>Filename: libraries/airport_mailer.php</p> 
      <p>Line Number: 109</p> 

      </div><br /> 
      <b>Fatal error</b>: Call to a member function initialize() on a non-object in <b>/home/goairport/public_html 
      /application/libraries/airport_mailer.php</b> on line <b>109</b><br /> 
+0

がここ –

+0

ポスト完全な誤りであなたにロードされた電子メールをしたことができますが、この '致命的なエラーの例質素 –

+0

にサーバー –

答えて

0

email libraryをロードしていないと思います。 $this->email->initialize($config);の前にこの行を追加してemail libraryを読み込んでください。

$this->CI->load->library('email'); OR 
$this->load->library('email'); 

関連項目:CodeIgniter Sending Email

+0

電子メールライブラリファイルを送信しましたか? –

+0

ビルドされています。 – Ali

+0

可能であれば、あるライブラリを他のライブラリに呼び出すことはできますか? –

関連する問題