Professional Documents
Culture Documents
PHP NOTE (Sending E-Mail)
PHP NOTE (Sending E-Mail)
Sendmdil.
Prcgvarn:
hdml7 : i i t ) soi2-
chead <4RtHe7 Send email 41itte <1head7
body7
4hl7 Send emil <lhiz
br7
foTm method "post" acifon =
"phpemail. php7
Please type you Comments and, cltek suonmit :
ba7
entaLa name 50" Nws = "s'Y<ltextMea 7
:
"message" Cets
Abar
Input type = "Submtt"
value -"Submit">
2 body7
21htmd
Output:
@phpemal- ktml
Send ema
please type yo Commevts and. etk subnl+:
Submlt
phpemail.php
htmz
4heady 4HHe7 Your emal was sent <Hte7 <Iheadz
<body7
h7 Youy ema uwas Sent)hlz
Thanks Ror youn emal.
ba7
2php i t
mail"steve @fspname.com",webmad 4REQUEST I"messa "1)5
2Ioody7
chtml7
Output ,
@phpemai.php
Your email was gent
Thanks bi youn email.
SENDING ADVANCED E.má
Phpadvemail. html
4html7
head HHe7 Send. amail with headens <ittey 21head
body7
hI7 send em with headers <lhtz
foTm method "post" actfon » "phpadvemau php 7
Aba7
om7
41body7
lhtml
Output
phpadvemall. ht mlL
Submit
Phpadvemdd.php
Ahtml7
emad Was sent 1tHey <lheady
Lhead 4ittez Your
body7
was sent <Ihiz
Zh7 your emal
uith headers.
Thanks for youT emdi
bnz
49php
headers
A(fsset C$-REQUEST [ 'ee "I))
$headers. "ce: ".". 4RequEST [ e"]. "l«\»"s
headers. "bec .
4REQUESTC"bee"] . "1r\n";
Sresut mall("teve@lspname.dom"we Ml
$RE6UEST I "message "J , $headuns)
97
41body7 A]html7
utput:
phpadvemál.php
Ybuun enmal was sedt
additonal
emdil from PHP, although that takes Some
woTk
Example
htaml
head7 4HHe7 Sending emu ith atachments e
fhend
&bady7
h7 Sendtng ema cuith atachmerts
<1N7
2php
$to steve @fspname Com 3
attachment"mage. Jpg"s
$atochnent- MiME type "mag |Jpeä "st
$handle fopen C^attachment, "nb")
=
Gdata, =
Chunk-Split (base b4- encade $data) )
tert -- ".boundary. "\n.
i CAresul)
R
echo he emdl wuas sent
else
27
<lbody 2Ihtml7
Output:
phpematlatlachmonts. php
Sending emal uth attachments