일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- ip직접접근차단
- JS
- 날짜비교
- MySQL
- Ajax
- iframe
- selinux
- 디지털 정부서비스ui/ux
- 정규식
- 우분투
- Vanilla JS
- virsualhost
- 보안인증서
- 정부 서비스 가이드라인
- SSL
- post_type
- 애니메이트
- .htaccess
- 날짜변환
- 페이지전환효과
- 우분투 npm 설치
- 배열
- 자바스크립트
- 301 리다이렉트
- JavaScript
- 구글뷰어
- 글자 수 제한
- 비동기호출
- 글자수제한
- 리사이즈
- Today
- Total
더 나은 프로그래머가 되자
php 메일 보내기 본문
<?php
// 받는 사람이 여럿일 경우 , 로 늘려준다.
$to = 'aidan@example.com' . ', '; // note the comma
$to .= 'wez@example.com';
// 제목
$subject = 'Birthday Reminders for August';
// 내용
$message = '
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
<th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
<td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
</tr>
<tr>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>
</html>
';
// HTML 내용을 메일로 보낼때는 Content-type을 설정해야한다
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=euc-kr' . "\r\n";
// 추가 header
// 받는사람 표시
$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
// 보내는사람
$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
// 참조
$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
// 숨은참조
$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";
// 메일 보내기
mail($to, $subject, $message, $headers);
?>
'언어 > PHP' 카테고리의 다른 글
RSS 피드 만들기 (0) | 2014.03.14 |
---|---|
소켓 인증을 통한 구글 메일 발송 (0) | 2013.01.31 |
숫자 앞에 0 붙이기 sprintf (0) | 2012.10.25 |
변수명을 변수 값으로 사용하기 (0) | 2012.10.24 |
register_globals 설정 $_POST, $_GET, $_COOKIE,$_SESSION (0) | 2011.09.30 |