하얀늑대 :: 하얀늑대의 일상
bloghome Tags |  Guestbook | 
  Tags
애완 광고 듀얼모니터 웹 접근성 XP 입냄새 쇼핑몰 포커스 혈액형 아이디어 미용 강아지 AB형 속도개선 투표 사이트관리 wap 애완동물 호출 DVD
banner
하얀늑대 ::
하얀늑대의 일상

Google
내블로그에서 검색
 하얀늑대는?
 Category
allow  모두보기 (275)
spacespace Today Story's (11)
spacespace 핫이슈 (19)
spacespace 디카질 (4)
spacespace Javascript (15)
spacespace 2000 server (9)
spacespace 2003 server (3)
spacespace 리눅스 (3)
spacespace UCC (6)
spacespace 컴퓨터 Tip (15)
spacespace IT news (65)
spacespace 웹 접근성 (3)
 Tags
카운터 패션 따뜻한 세상 paypal 사진 메일보내기 기획 비즈니스모델 듀얼모니터 역발상 IBM UCC 쿠폰 MSXML2.ServerXMLHTTP 롱혼 웹사이트구축 utf-8 가상현실 호출 sql
  Calendar
<< 2012 May >>
S M T W T F S
29 30 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 1 2
 New Post
line 중국 오픈마켓 시장 진출
line 중국 오픈마켓 시장 진출
line 중국 인터넷 시장의 국제화
line 중국 인터넷 쇼핑몰 시장의
line 중국 인터넷, 바이러스 마
 New Comment
lineselee2000 : 10/10/27
reply멋진데요.
line클럽4242 : 10/08/26
reply사랑에상처는 사랑으로 치
linesusanna : 08/11/07
replyhey,find <a href=http:
line하얀늑대 : 08/05/22
reply위에 페이지는 한페이지 내
line아아아 : 08/04/26
reply개새끼는너야
 New Tracbacks
lineWeb 1.0 과 Web 2.0
line06/11/18
line괴물 - 2006. 7. 28.
line06/07/29
 New Archive
2011 April (13)
2011 March (2)
2011 January (1)
2010 December (1)
2010 November (1)
...more
  Link Site
올블로그
KOON
태터툴즈
엑스파이더
심프로그
디지털예보
thesimplog.com
feed rss
 Visitor Statistics
Total  :  336635
Today :  54
Yesterday :  90


 Google



blog bar tagsbar guest loginbarlogoutbarX-inbar
line mail() 함수 메일보내기
PHP 프로그래밍 | 06/05/29 | 하얀늑대

<?php # Is the OS Windows or Mac or Linux
if (strtoupper(substr(PHP_OS,0,3)=='WIN')): $eol="rn"; elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')): $eol="r"; else: $eol="n"; endif;
?>

<?php
# File for Attachment
$f_name="../../letters/".$letter;   
// use relative path OR ELSE big headaches. $letter is my file for attaching.
$handle=fopen($f_name, 'rb'
);
$f_contents=fread($handle, filesize($f_name
));
$f_contents=chunk_split(base64_encode($f_contents));   
//Encode The Data For Transition using base64_encode();
$f_type=filetype($f_name
);
fclose($handle
);
# To Email Address
$emailaddress="him@her.com"
;
# Message Subject
$emailsubject="Heres An Email with a PDF".date("Y/m/d H:i:s"
);
# Message Body
ob_start
();
  require(
"emailbody.php");   
// i made a simple & pretty page for showing in the email
$body=ob_get_contents(); ob_end_clean
();

# Common Headers
$headers .= 'From: Jonny <jon@genius.com>'.$eol
;
$headers .= 'Reply-To: Jonny <jon@genius.com>'.$eol
;
$headers .= 'Return-Path: Jonny <jon@genius.com>'.$eol;   
// these two to set reply address
$headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol
;
$headers .= "X-Mailer: PHP v".phpversion().$eol;         
// These two to help avoid spam-filters
# Boundry for marking the split & Multitype Headers
$mime_boundary=md5(time
());
$headers .= 'MIME-Version: 1.0'.$eol
;
$headers .= "Content-Type: multipart/related; boundary="".$mime_boundary.""".$eol
;
$msg = ""
;

# Attachment
$msg .= "--".$mime_boundary.$eol
;
$msg .= "Content-Type: application/pdf; name="".$letter.""".$eol
// sometimes i have to send MS Word, use 'msword' instead of 'pdf'
$msg .= "Content-Transfer-Encoding: base64".$eol
;
$msg .= "Content-Disposition: attachment; filename="".$letter.""".$eol.$eol;
// !! This line needs TWO end of lines !! IMPORTANT !!
$msg .= $f_contents.$eol.$eol
;
# Setup for text OR html
$msg .= "Content-Type: multipart/alternative".$eol
;

# Text Version
$msg .= "--".$mime_boundary.$eol
;
$msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol
;
$msg .= "Content-Transfer-Encoding: 8bit".$eol
;
$msg .= "This is a multi-part message in MIME format.".$eol
;
$msg .= "If you are reading this, please update your email-reading-software.".$eol
;
$msg .= "+ + Text Only Email from Genius Jon + +".$eol.$eol
;

# HTML Version
$msg .= "--".$mime_boundary.$eol
;
$msg .= "Content-Type: text/html; charset=iso-8859-1".$eol
;
$msg .= "Content-Transfer-Encoding: 8bit".$eol
;
$msg .= $body.$eol.$eol
;

# Finished
$msg .= "--".$mime_boundary."--".$eol.$eol
// finish with two eol's for better security. see Injection.

# SEND THE EMAIL
ini_set(sendmail_from,'from@me.com'); 
// the INI lines are to force the From Address to be used !
 
mail($emailaddress, $emailsubject, $msg, $headers
);
ini_restore(sendmail_from
);
?>


태그: 메일보내기
bullet관련글0 | 댓글0
Name :   Pass :  URL :
비밀글로 등록  submit
이전/ 264 265 266 267 268 [269] 270 271 272 273 / 다음 top