douyaju4259 2013-12-10 14:57
浏览 51
已采纳

无法使用PHP从appfog发送电子邮件

This is my first time using appfog. I have a PHP application. I want to send email from the PHP application using appfog. I am using CodeIgniter framework.

I can send email from my localhost. But when I try to do the same thing using appfog I am getting error. It is saying that authentication has failed. My email sending PHP code is given below.

$config = Array(
                'protocol' => 'smtp',
                'smtp_host' => 'ssl://smtp.googlemail.com',
                'smtp_port' => 465,
                'smtp_user' => 'shamir.towsif@gmail.com',
                'smtp_pass' => 'xxxx',
                'mailtype' => 'html',
                'charset' => 'iso-8859-1',
                'wordwrap' => true
            );
            $message = "Random message";
            $this->load->library('email', $config);
            $this->email->set_newline("
");
            $this->email->from('shamir.towsif@gmail.com', 'Vatiali');
            $this->email->to($this->input->post('email'));
            $this->email->subject('Verify Email');
            $this->email->message($message);
            $this->email->send();
  • 写回答

1条回答 默认 最新

  • douwuying4709 2014-02-19 11:28
    关注

    Another option could be to use AWS SNS to send your emails. Pretty easy to setup using the AWS SDK for PHP. You also get 1000 free messages per month on the free tier.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?