Ik heb in de search heel veel hierover gevonden, en daarom schaam ik me ook kapot.
Maar hij doet het niet.
Ik heb deze code:
Hij verstuurt de mail wel, maar de hele attachment komt in de message.
Het zijn dan allemaal rare tekens.
Als ik echter andere voorbeelden gebruik van oa
http://nl2.php.net/manual/nl/ref.mail.php
(bijna onderaan)
Dan krijg ik een mail die helemaal nix heeft. Geen content, geen attachment.
Kan iemand mij alsjeblieft helpen?
Maar hij doet het niet.
Ik heb deze code:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| $headers = "From:ESTEC <tegroen@home.nl>\n";
$headers .= "Content-Type: text/html;charset=iso-8859-1";
$x = 1;
$attachment_name = $_FILES["attachment". $x]["name"];
$attachment_tmp_name = $_FILES["attachment". $x]["tmp_name"];
$type = $_FILES["attachment". $x]["type"];
$data = fread(fopen($attachment_tmp_name, "r"), filesize($attachment_tmp_name));
$attachment = chunk_split(base64_encode($data));
$boundry = "------=MIME_BOUNDRY_main_message";
$body .= "\n\n--". $boundry;
$body .= "\nContent-Type:". $type. ";";
$body .= "\n\tname=\"". $attachment_name. "\";";
$body .= "\nContent-Transfer-Encoding: base64";
$body .= "\nContent-Disposition: attachment;";
$body .= "\n filename=\"". $attachment_name. "\"";
$body .= "\n\n". $attachment;
}
mail($address, $_POST["subject"], $body, $headers); |
Hij verstuurt de mail wel, maar de hele attachment komt in de message.
Het zijn dan allemaal rare tekens.
Als ik echter andere voorbeelden gebruik van oa
http://nl2.php.net/manual/nl/ref.mail.php
(bijna onderaan)
Dan krijg ik een mail die helemaal nix heeft. Geen content, geen attachment.
Kan iemand mij alsjeblieft helpen?
If then else matters! - AMD 9800X3D, Gigabyte Gaming OC 16G 5080 RTX, MSI MAG B850, 32GB DDR5, Corsair RM850X PSU, SN850 1TB, Arctic Liquid Freezer 280, TP-Link AXE5400 Wi-Fi 6E Router