1
텍스트 메일은 정상적으로 작동하지만 파일도 첨부하고 싶습니다. 첨부 파일이 작동하지 않습니다. 내 코드는 다음 코드를 작동하지만 파일 위첨부 파일이 메일 기능 WordPress에서 작동하지 않습니다
<form method="post" enctype="multipart/form-data">
<input name="filepc" type="file" id="filepc" class="listEm" />
</form>
if (isset($_POST['submit'])) {
$attachments = '';
if (!empty($_FILES['filepc']['tmp_name'])) {
$attachments = array($_FILES['filepc']['name']);
}
headers = "From:" . $your_email . " < " . $email . ">" . "\r\n";
$headers .= "Reply - To:" . $ct_email . "\r\n";
$headers .= "Content-Disposition: attachment; filename=\"".$attachments."\"\r\n\r\n";
//$headers = "Bcc: [email protected] . com" . "\r\n";
$headers = "X - Mailer: PHP/" . phpversion();
mail($to , $subject , $msg , $headers,$attachments);
$successMsg = '<h5 style="color:red;">Sent successfully</h5>';
// }
}
가 연결되어 있지 않습니다. 이 문제에 대한 해결책을 찾도록 도와주세요.
$ msg = "\ n \ n" "전화 : $ 제목". "\ n". "이름 : $ first_name" "\ n". "성 : $ last_name" "\ n". "첨부 파일 : echo '이미지 : ';" . "\ n". "연락 할 선호 모드 : $ prmode". "\엔"; 첨부 파일이있는 전자 메일에이 메시지를 추가하는 방법 – user2851129
여러 첨부 파일을 사용하는 방법 – user2851129
나는 그것을 수행했습니다. tq – user2851129