-1

My code:

 $config['protocal'] = 'smtp';
 $config['mail_path'] = 'ssl://smtp.googlemail.com';
 $config['smtp_host'] = 'ssl://smtp.googlemail.com';
 $config['smtp_port'] = 465;
 $config['smtp_user'] = 'mygmail@gmail.com';
 $config['smtp_pass'] = 'mypass!';
 $config['charset'] = "utf-8";
 $config['mailtype'] = "html";

 $this->load->library('email', $config);
 $config['newline'] = "\r\n";

 $this->email->initialize($config);

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

 $this->email->from('info@maaden.com.sa','Blowing Notification');
 $this->email->to('eduardodbarrete@gmail.com');
 $this->email->cc('eduardobarrete@gmail.com'); 
 $this->email->subject('Whistle Receipt');

 $message  =  "<p> Thank you for the report you submitted </p>";
 $message .=  "<p> Report ID: <strong>" . $session_id . "</strong></p>";
 $message .=  "<p> Your Email: <strong>" . $this->input->post('email') . "</strong></p>";


 $this->email->message($message);
 $this->email->send();


 echo $this->email->print_debugger();

Th print_dubugger(); output below;

Your message has been successfully sent using the following protocol: mail
User-Agent: CodeIgniter
Date: Tue, 8 Oct 2013 12:13:46 +0300
From: "Blowing Notification" 
Return-Path: 
Cc: email.com.sa
Reply-To: "no-reply@email.com" 
X-Sender: no-reply@email.com
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <5253ccca8ee37@email.com.sa>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_5253ccca8eeae"

On the above print_debugger(); output i don't see any "To" where should my email go. Maybe the reason why i didn't receive any email. Thanks

4

1 回答 1

0

你需要像这样配置你的 smtp 服务器信息:</p>

$config = Array(
            'protocol'  => 'smtp',
            'smtp_host' => 'ssl://smtp.googlemail.com',
            'smtp_port' => '465',
            'smtp_user' => 'someuser@gmail.com',
            'smtp_pass' => 'password',
            'mailtype'  => 'html',
            'starttls'  => true,
            'newline'   => "\r\n"
        );

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

        $this->email->from('someuser@gmail.com', 'invoice');
        $this->email->to('test@test.com');
        $this->email->subject('Invoice');
        $this->email->message('Test');

        $this->email->send();
于 2013-10-08T14:12:55.650 回答