Codeigniter SMTP Email with Amazon SES

后端 未结 5 1939
天命终不由人
天命终不由人 2021-02-05 06:43

I think yesterday Amazon announced SMTP support for SES (Simple Email Service).

I tried to send SMTP email with Codeigniter with no luck.

I have a verified sende

5条回答
  •  终归单人心
    2021-02-05 07:14

    The setup that worked for me looks like this:

    $test_config['protocol'] = 'smtp';
    $test_config['smtp_host'] = 'ssl://email-smtp.us-east-1.amazonaws.com';
    $test_config['smtp_port'] = '465';
    $test_config['smtp_user'] = 'XXXXXXXXXXXXXXXXXXX';
    $test_config['smtp_pass'] = 'YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY';
    $test_config['newline']      = "\r\n"; 
    
    $this->email->initialize($test_config);
    
    $this->email->from('from@test.com', 'From at Test.com');
    $this->email->to('To@Test.com');
    
    $this->email->subject('Email Test');
    $this->email->message('Testing the email class.');
    
    $this->email->send();
    

    The newline character must be set to "\r\n", and can bet set in the config file, if properly set as "\r\n", not '\r\n' as noted above.

提交回复
热议问题