Problema com Anexos
Boas Malta,
Estou com problemas ao receber anexos no email..
Quando envio algum anexo, ele indica "Anexo: ficheiro1.jpg" ou "Anexo: ficheiro.rar" tudo ok.. mas quando clico nele, o link não é o correcto, e da-me um link com uma extensão enorme.
Seguinte função
$has_attachment = preg_match_all("/multipart\/mixed/", $email_body, $attachment);
if ($op_getKey) {
if ($has_attachment) {
$mailParts = explode("--" . $getKey[1][1], $email_body);
$attachParts = explode("--" . $getKey[1][0], $email_body);
$get_attach_name=preg_match_all("/filename=\"(.*?)\"/", $attachParts[2], $attach_name);
$get_attach_type=preg_match_all("/Content-Type: (.*?);/", $attachParts[2], $attach_type);
$pure_code = explode("\n\n",$attachParts[2]);
$pure_code = str_replace("\r","",$pure_code[1]);
$pure_code = str_replace("\n","",$pure_code);
}else{
$mailParts = explode("--" . $getKey[1][0], $email_body);
}
.........
E estou a fazer a chamada desta forma
<a target="_blank" href="data:<?=$attach_type[1][0]?>;base64,<?=$pure_code?>"> <?=$attach_name[1][0]?> </a>
AbraçoDiscussão (4)
Carregando comentários...