Ecco una possibile soluzione, scritta in C++:
codice:
#include <stdio.h>
int main(int argc, char* argv[]) {
FILE *stream;
char buffer[81];
int i,ch;
bool leggi=true;
if ((stream=fopen("prova.txt","a"))!=NULL) {
while (leggi) {
// Prende massimo 80 byte alla volta
for(i=0;(i<79)&&((ch = getchar()) != EOF)&&(ch != '\n');i++) {
buffer[i] = (char) ch;
}
buffer[i++] = '\n'; // <= termine di riga
// Li schiatta nel file a 80 colonne
fwrite(buffer,sizeof(char),i,stream);
if ((buffer[0]=='.')&&(buffer[1]=='\n')) {
leggi=false;
}
}
fclose(stream);
} else {
return 1;
}
return 0;
}
ho cambiato il PHP.INI come segue:
codice:
[mail function]
; For Win32 only.
;SMTP = localhost
; For Win32 only.
;sendmail_from = me@localhost.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = c:\sendmail.exe
Faccio due prove e vi dico...