mail2sms...2
Jeg er ved at lave et lille script der skal kunne læse mail direkte fra serveren:<?
$path="/var/spool/mail/";
$entry="mail2sms";
$fp = fopen("$path$entry","r");
while( $line = fgets( $fp, 4096 ) ) {
echo $line;
};
fclose($fp);
?>
Virker også fint nok..
Men vil gerne have from,to,subjekt,mailteksten ud i variabler af samme navn.. og derefter få den udskrevet på skærmen..
Eksempelmails:
From s@computopic.dk Tue Mar 4 18:02:26 2003
Return-Path: <s@computopic.dk>
Received: (from www@localhost)
by ns1.computopic.dk (8.11.6/8.11.0) id h24H2PA22481;
Tue, 4 Mar 2003 18:02:25 +0100
Date: Tue, 4 Mar 2003 18:02:25 +0100
Message-Id: <200303041702.h24H2PA22481@ns1.computopic.dk>
X-Authentication-Warning: ns1.computopic.dk: www set sender to s@computopic.dk using -f
From: "S" <s@computopic.dk>
To: 25370233@computopic.dk
Reply-To: s@computopic.dk
Subject: test
X-Mailer: NeoMail 1.25
X-IPAddress: 62.61.154.25
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
hej hej
From s@computopic.dk Tue Mar 4 18:02:26 2003
Return-Path: <s@computopic.dk>
Received: (from www@localhost)
by ns1.computopic.dk (8.11.6/8.11.0) id h24H2PA22481;
Tue, 4 Mar 2003 18:02:25 +0100
Date: Tue, 4 Mar 2003 18:02:25 +0100
Message-Id: <200303041702.h24H2PA22481@ns1.computopic.dk>
X-Authentication-Warning: ns1.computopic.dk: www set sender to s@computopic.dk using -f
From: "S" <s@computopic.dk>
To: 25370233@computopic.dk
Reply-To: s@computopic.dk
Subject: test2
X-Mailer: NeoMail 1.25
X-IPAddress: 62.61.154.25
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
hej2 hej2
