| 제목 | Google SMTP로 메일 보내기. | ||
|---|---|---|---|
| 글쓴이 | 마냐 | 작성시각 | 2009/07/22 00:09:05 | 
|  | |||
| 
// 설정 
$config['mailtype']  = "html"; 
$config['charset']   = "euc-kr"; 
$config['protocol']  = "smtp"; 
$config['smtp_host'] = "ssl://smtp.googlemail.com"; 
$config['smtp_port'] = 465; 
$config['smtp_user'] = "이메일주소"; 
$config['smtp_pass'] = "비밀번호"; 
$config['smtp_timeout'] = 10; 
$this->load->library('email', $config); 
$this->email->set_newline("\r\n"); 
$this->email->clear(); 
$this->email->from("이메일주소", "관리자"); 
$this->email->to("보내는메일"); 
$this->email->subject("제목"); 
$this->email->message("내용"); 
if (!$this->email->send()) 
  echo "실패"; 
else 
  echo "성공"; 네이버, 드림위즈, Gmail 로 보내기 테스트 해봤습니다. SMTP로 For 문 돌리는건 자제요. ㅡ_ | |||
| 태그 | email,google,smtp | ||
| 다음글 | CI 사용시 index.php 줄이기 서버세팅 (1) | ||
| 이전글 | fckeditor용 이미지 DB insert | ||
| 
                                리누스토발즈
                                /
                                2014/01/29 04:42:11 /
                                추천
                                0
                             | 
Cafe24의 호스팅을 받고있는데, Cafe24의 경우
SMTP포트번호로 587번을 사용하고 있어, 이 부분만 수정하였더니 성공했습니다.
본래 25번이 SMTP의 포트번호이나
우리나라는 정책상 587번을 SMTP번호로 사용한다고합니다.
그리고, 위와같이 SSL/TLS를 이용하는 SMTP번호는 465번이니 다른분들이 참고하셨으면 좋겠습니다.