[PHP] mailscript met bijlage

Pagina: 1
Acties:
  • 596 views sinds 30-01-2008
  • Reageer

Onderwerpen


Acties:
  • 0 Henk 'm!

Verwijderd

Topicstarter
Hoi allemaal, daar ben ik weer.

Ik heb allerlei fora afgezocht maar nergens een duidelijk antwoord gevonden.

Ik heb een email form waarin ook een document moet worden meegezonden.

in sendmail.php
haal ik dit bestandje op als
PHP:
1
$file = $_FILES['bestand'];


verder heb ik in het script staan:
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$ontvanger= "$email";
$onderwerp = "onderwerp";         
$message .=" <meta http-equiv=\"Content-Language\" content=\"nl\" />
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />

<style type=\"text/css\"> 
<!--
body {  margin-left: 3px;   margin-top: 0px;    margin-right: 0px;  margin-bottom: 0px;}
-->
.style1 {   font-family: Verdana;   font-size: 12px;    color: #000000;}
.style2 {   font-family: Verdana;   font-size: 10px;    color: #000000;}
</style></head>
<body>";
$message .="====================================<br>";
$message .="         <b>tekst tekst</b><br>";
$message .="<br>";
$message .="====================================<br>";  


$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html;charset=ISO-8859-9\n";
  
   mail($ontvanger, $onderwerp, $message, $headers);


ik heb enkele scripts geprobeerd, amar kom er gewoon niet uit om de $_FILES['bestand']; in de attachment te krijgen.. help me plzz

het script wat ik had gevonden was spaans ofzo maar hier staat het, sorry ik kon er niet, uit kunnen jullie me helpen ??

PHP:
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
31
$arquivo = "spider.jpg";
$tipo = "image/jpg";

//$arquivo is file and $tipo is type

$abreArquivo = fopen ($arquivo, "r");

//$abreArquivo is openFile

$dados = fread ($abreArquivo, filesize($arquivo));
fclose ($abreArquivo);
$encode_anexo = chunk_split (base64_encode($dados));

$cabeca = "--Message-Boundary\n";
$cabeca .= "Content-type: text/plain; charset=US-ASCII\n";
$cabeca .= "Content-transfer-encoding: 7BIT\n";
$cabeca .= "Content-description: Mail message body\n\n";

$corpo = $cabeca . $corpo;

//$corpo is BODY

$corpo .= "Your text here HERE\n";
$corpo .= "\n\n--Message-Boundary\n";
$corpo .= "Content-type: $attach_type; name=\"$arquivo\"\n";
$corpo .= "Content-Transfer-Encoding: BASE64\n";
$corpo .= "Content-disposition: attachment; filename=\"$arquivo\"\n\n";
$corpo .= "$encode_anexo\n";
$corpo .= "--Message-Boundary--\n";

mail("diexmax@rediffmail.com< please remove my e-mail it&#65533;s only one example>", "Your subject", $corpo, $headers);

[ Voor 38% gewijzigd door Verwijderd op 09-02-2006 15:17 ]


Acties:
  • 0 Henk 'm!

  • NMe
  • Registratie: Februari 2004
  • Laatst online: 09-09 13:58

NMe

Quia Ego Sic Dico.

Als ik bijna letterlijk op je topictitel zoek dan is het bij mij bij de eerste hit al raak en opgelost. :?

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.


Acties:
  • 0 Henk 'm!

  • Nijl
  • Registratie: Juni 2004
  • Laatst online: 19-09 09:39

Nijl

Eens een Nijl, altijd een Nijl

waarom gebruik je phpmailer niet. die is keigoed, veel opties, en heel simpel. hoef je ook niet bang te zijn dat je script misbruikt gaat worden als er een bug inzit.

You are NIJL-ed!