我尝试使用以下代码发送带附件的电子邮件,但它只显示如下文字
$filename = basename($file);
$file_size = filesize($file);
$content = chunk_split(base64_encode(file_get_contents($file))); //echo $content; exit(0);
$uid = md5(uniqid(time()));
$message .= $content."\r\n\r\n"
."--".$uid."--";
iVBORw0KGgoAAAANSUhEUgAABVYAAAMACAIAAABAXKuVAAAAAXNSR0IArs4c6QAAAARnQU1BAACx jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAASdEVYdFNvZnR3YXJlAEdyZWVuc2hvdF5VCAUA AP + HSURBVHhe7J0HXBXH2v / 5317ee9 / bcpPb3pvkJrlJboqpNz0xMaYXE001PTG9GGOLNfYOIkqR IqggiF1BUHoTUVCkg / QiHYFz4Aic839mZ3d2dnbP4VBMLM / Z + brOzj4zOztnds88v7O7uPzqqk + G k6s / + TXhU5FrPv0flc9U / v3ZbzR8LnMt4bcC131B + V + B6ylf / k7gP4yvfs9zg8ofCBNlblT5I +嗡R3N + xLgZmMRzCWUE4xvKnym3CEy + lHKrnimX3WbMX24Hpur56x2MaRrunPY3lekq / 53 + d5Fv / 34X 4R967gZm / J + eeygz / ylwr8zlhFkq98lcoTL7ivs1XMl4YA7PvxgPUuZSrmI8xPPd1YyRAvOuAR42 4N / AI / P1XAuMoiwQuO5RxkKe60cLLCI8tug / HJY + GLhBzxPAkhv1PEm4ibBUw1OEm1WWEZ5WGaGy fMQzKrfwPAusoNzK8xxlJeU2yvMCq26njBG5g + B6xwsid1JedNPzX2AsZTXPXeME3Cl3v6RnDeHl NfcY8orHvYa86nEfYa2G12TuJ6xTeV3mARVPwniZBwXe8KI8JPAm4E0ZyXiLx + dhxtsaHiGsJ7wj MorgO + pdkUcp7wF + PKOB93n8KY8BHwgEUB6fYMiGJz405smPgECRjwlPEYI0fEJ4WmWjzKeEZ0Q2 PfOZzLMCn2 + mPMfzBSP4eZ4vVcYQQmS + 0vACYQthooYXGV + H8oylTGKEMcYB3 / BspbwETNYT / jIw xZhXpm4zYNq2VwnbRaZvf01lh8q3O17XsFNmBmG8wMxdlDcEZlF2vykwm7HnLZ45Km8T9srMV XMH 8d0 + nncZ84AInvco8xmRlPcpCwT2f0BZqCdqwiJjPlwMROv5aAnjgIalBz5WOaiy7OAnIjGfLCd8 qmcFEPuZnpWUuM8FVsl8QYhXcZX5UiXhSzcNXzFWJ / JMZLhTkihfM9bwJE9ieAikfAOsNWAysC5V zxTAk5ImMNWLcYhnmrdAOsEnfboh6w8D3
希望有人能提供帮助。谢谢你提前。