Ciao a tutti,
questa è la mia prima discussione e innanzi tutto vorrei salutare tutti quanti le persone presenti sul forum.
Sto realizzando un sito internet in HTML e ho inserito uno script PHP per l'invio di email con allegato ma essendo superinesperto vorrei aumentare la dimensione massima dell'allegato.
Qui di seguito inserisco il codice PHP, insieme a questo ho un file HTML uno FLA ed uno Flash.
Come devo fare?
Grazie a tutti in anticipo.
<?
$attach=false;
//$to="Questa la modifico io in seguito!!";
$to= $_REQUEST['fromemail'];
$subject="Email proveniente da ialt.it";
$from = stripslashes($_REQUEST['fromname'])."<".stripslashes($_REQUEST['fromemail']).">";
$message = stripslashes($_REQUEST['message']);
$message = UTF8_decode($message);
$mime_boundary="==Multipart_Boundary_x".md5(mt_ran d())."x";
$attach = $_REQUEST['attach'];
if ($attach) {
$tmp_name = $_FILES['Filedata']['tmp_name'];
$type = $_FILES['Filedata']['type'];
$name = $_FILES['Filedata']['name'];
if(is_uploaded_file($tmp_name)){
$message .= "\n\nIn allegato il file: $name";
$file = fopen($tmp_name,'rb');
$data = fread($file,filesize($tmp_name));
fclose($file);
$data = chunk_split(base64_encode($data));
$headers = "From: $from\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type: multipart/mixed;\r\n" .
" boundary=\"{$mime_boundary}\"";
$message .= "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type: text/plain; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$message . "\n\n";
$message .= "--{$mime_boundary}\n" .
"Content-Type: {$type};\n" .
" name=\"{$name}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mime_boundary}--\n";
if(mail($to, $subject, $message, $headers)){
echo "success=true";
}
}
} else {
$headers = "From: $from\r\n";
if(mail($to, $subject, $message, $headers)){
echo "success=true";
}
}
?>