Hi everybody
The idea is the following :
When an alias address mail (
ZZZ@MYDOMAIN.be) receives an email, it launches automatically a PHP script wich makes it possible to spare the rough message by finding the headings and the content and to store all this inframtion in a mySQL database.
With the help of scounet, we could make so that alias (
ZZZ@MYDOMAIN.be), instead of forwarding towards another email address, opens a PHP script placed at the root.
e.g. :
/spinternet.be/users/MYDOMAIN/public_html/script.php (Thanks Jooris)
I would like to open the mail I receive trough my script "script.php" (placed where you know)
This is the code
"
<?php
// read from stdin
$fd = fopen("php://stdin", "r");
$email = "";
while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd);
require("connect.php"); // Just to open correctly the mySQL databases $sql = "INSERT INTO mails (Contenu)
VALUES ('$email')";
// we put information into field text 'Contenu' of a base 'mails' mysql_query($sql) or die('Erreur SQL!'.$sql.'<br>'.mysql_error());
?>"
As you can see, I try to open (via the fopen command) the file
"php://stdin"... and to put it into a variable.
I can check that the reception of a mail launches well the script "script.php"
but it doens't work... In fact, the script cannot open the file "
php://stdin"... I guess it doesn't find it !
So my question is :
Are there the correct path and the correct name ?
Thx for your help !
Sahi