2017-04-22 15 views
1

私のドメイン用のGoogle Mxレコードを設定しました。通常のgmailアカウントを使用するとメールが送信されますが、gsuiteアカウントを使用するとメールは送信されません。 sitegroundに私のサイトをホスティングしています。しかし私はgsuiteアカウントの他の電子メールアカウントから電子メールを受け取ることができます。Gsuiteアカウントは電子メールを送信しませんcodeigniter

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

    $subject = 'Subject'; 
    $message = 'My message'; 

    //configure email settings 
    $config['protocol'] = 'smtp'; 
    $config['smtp_host'] = 'ssl://smtp.gmail.com'; 
    $config['smtp_port'] = 465 
    $config['smtp_user'] = '[email protected]'; 
    $config['smtp_pass'] = 'my_password'; 
    $config['mailtype'] = 'html'; 
    $config['charset'] = 'utf-8'; 
    $config['wordwrap'] = TRUE; 
    $config['newline'] = "\r\n"; //use double quotes 
    $config['validation'] = TRUE; 
    $this->email->initialize($config); 

    //send mail 
    $this->email->from('[email protected]', 'MyDomainName'); 
    $this->email->to($to_email); 
    $this->email->subject($subject); 
    $this->email->message($message); 

    //echo json_encode($this->email->print_debugger()); 
    if($this->email->send()) 
    return true; 
    else 
     return false;  

答えて

1

あなたはすべてのエラーメッセージを添付していなかったが、それはあなたの他のGmailアカウントのために働いているため、このアカウントの「安全性の低いアプリ」へのアクセスをオンにすると、この問題が解決するかどうかチェックしてみてくださいとバック報告しています。

https://myaccount.google.com/lesssecureapps (複数のアカウントにログインしている場合は、正しいアカウントを選択することを忘れないでください)。

+0

おかげさまで、私は他のgmailアカウントのセキュリティで保護されていないアプリケーションオプションをオンにしていたので、なぜ私はそれを逃したのか分かりません。 – facilitator

関連する問題