Perl‚ÅSMTP-AUTH”FØ‚ð‚·‚é

* No Comments * No TrackBacks

Noel Cafe‚ÅŽg—p‚µ‚Ä‚¢‚éƒT[ƒo[Lolipop‚ªƒpƒ[ƒAƒbƒv‚µ‚½B
‚¢‚ë‚¢‚ëŠì‚΂µ‚¢‚±‚Æ‚Å‚Í‚ ‚邪A
Ž©ìCGI‚̉ü—Ç‚ª•K—v‚É‚È‚Á‚Ä‚µ‚Ü‚Á‚½B

Photo Blog‚Å‚Í
“Y•t•t‚«ƒ[ƒ‹‘—M¨Perl(Ž©ì)
@¨Movable Type“Še¨Twitpic“Še
@¨‚»‚Ì‘¼ƒT[ƒrƒX‚Öƒ[ƒ‹‚Å“Še
‚Æ‚¢‚¤Žd‘g‚Ý‚É‚È‚Á‚Ä‚¢‚éB
uƒ[ƒ‹‚Å“Šev‚ðLolipopƒ[ƒ‹‚ðŽg—p‚µ‚Ä‚¢‚é‚Ì‚¾‚ª
”FØ•û–@‚ªPOP before SMTP‚©‚çSMTP-AUTH‚É•Ï‚í‚Á‚½B
‚±‚Ì‚½‚߂ɁAƒXƒNƒŠƒvƒg‚̏‘‚«Š·‚¦‚ª•K—v‚É‚È‚Á‚½B

ˆÈ‰ºAPerl ‚Å SMTP-AUTH”FØ{ƒ¿‚ÌŠo‘B


‚¨‚¨‚æ‚»‚̃XƒNƒŠƒvƒg‚͈ȉº‚Ì‚Æ‚¨‚èB
$smtp->to(...)‚Ì‘O‚ɁA$smtp->auth(...)‚ð“ü‚ê‚Ü‚·B
(‰º‚Ì—á‚Å‚Í4s–Ú‚Å‚·)
(Ž„‚̓XƒNƒŠƒvƒg‚ª‚·‚Á‚«‚è‚·‚é‚Ì‚Å
MIME::Entity‚ðŽg—p‚µ‚Ü‚·B)

use NET::SMTP;
use MIME::Entity;
my $smtp = Net::SMTP->new($SENDM_S_SERVER, Port=>$SMTP_PORT);
$smtp->auth($SMTP_USER, $SMTP_PASS);
$smtp->mail($MAIL_FROM);
$smtp->to($MAIL_TO);
$smtp->data();
my $mail_data = MIME::Entity->build(
    From     => $MAIL_FROM,
    To       => $MAIL_TO,
    Subject  => $MAIL_SUBJECT,
    Type     => 'text/plain;charset="iso-2022-jp"',
    Data     => $MAIL_BODY,
    Encoding => "7bit"
);
$mail_data->attach(
    Path => $IMAGE_PATH ,
    Type => 'image/jpeg',
    Encoding => 'Base64'
);
$smtp->datasend($mail_data->stringify);
$smtp->dataend();
$smtp->quit;


‚³‚āA‘‚¢‚½‚à‚̂̃Gƒ‰[‚͏o‚È‚¢‚Ì‚É“®‚©‚È‚¢EEEB
‚®‚®‚Á‚½‚Æ‚±‚ëSMTP-AUTH”FØ‚É‚ÍAuthen::SASL‚ª•K—v‚炵‚¢B
ƒŒƒ“ƒ^ƒ‹ƒT[ƒo[‚Ȃ̂ŃCƒ“ƒXƒg[ƒ‹‚͏o—ˆ‚È‚¢‚ªA
mt/extlib‚ðŽQÆ‚µ‚Ä‚¢‚éƒXƒNƒŠƒvƒg‚Ȃ̂ŁA
mt/extlib“à‚ÉAuthen::SASL‚Ìlibƒtƒ@ƒCƒ‹“à‚ð‚Ô‚¿ž‚ÝŽŽsB
‚Æ‚è‚ ‚¦‚¸A‚±‚ꂾ‚¯‚ÅŠ®—¹‚µ‚Ü‚µ‚½B


ŽQl‚É‚µ‚½ƒy[ƒW (‚ ‚肪‚Æ‚¤‚²‚´‚¢‚Ü‚·I)


‚»‚ñ‚È–ó‚Å‹v‚µ‚Ô‚è‚Ì“Še‚É‚È‚Á‚Ä‚µ‚Ü‚¢‚Ü‚µ‚½B
Blog–{‘Ì‚àPhoto Blog‚àB

No TrackBacks




Leave a comment

(will not be published, but required * •K{‚Å‚·‚ª•\Ž¦‚³‚ê‚Ü‚¹‚ñ)
Heart Star Blink Star ô ôô Tear Sweat! Bomb é‘é Caution! Caution! Š^ Š^2 “e ƒpƒ“ƒ_ ‹› ‹à‹›
Smile1 Smile2 Smile3 Smile4 Smile5 Smile6 Leaf Red Leaf Yellow Leaf •– ‚à‚Ý‚¶ ‹âˆÇ(—Î) ‹âˆÇ(‰©) –Ø ÷ –Ø(Ô) –Ø(‰©)
Powered by MT Smileys

facebook Comments Form

April 2017

S M T W T F S
            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            

Recent Trackbacks

Monthly Archives