게시 된 전자 메일 주소를 사용하여 간단한 전자 메일을 HTML 및/또는 일반 텍스트로 보내는 전자 메일 스크립트가 여러 개 있습니다. Gmail 및 Outlook에서는 올바르게 표시되지만 eM에서는 표시되지 않으며 Communigate 서버를 통과하지도 않습니다. 코드 :eM 클라이언트에 멀티 파트 전자 메일이 올바르게 표시되지 않습니다.
의 Content-Type : 다음과 같은 메시지가 EM에 수신
<?php $email_address = addslashes($_POST['email_address']); if (!filter_var($email_address, FILTER_VALIDATE_EMAIL)) { header("Location: ./?error=invalid-email"); exit(); } $subject_line = "This is a test multi-part email"; $boundary = uniqid(); $headers = "MIME-Version:1.0\r\n"; $headers .= "From: Maggie Multipart <[email protected]>\r\n"; $headers .= "To: " . $email_address . "\r\n"; $headers .= "Content-Type: multipart/alternative;boundary=" . $boundary . "\r\n"; $message = "This is a MIME encoded message."; $message .= "\r\n\r\n--" . $boundary . "\r\n"; $message .= "Content-Type: text/plain;charset=utf-8\r\n\r\n"; $message .= "Hello,\nThis is a test email, the text/plain version.\n\nRegards\nMaggie Multipart"; $message .= "\r\n\r\n--" . $boundary . "\r\n"; $message .= "Content-Type: text/html;charset=utf-8\r\n\r\n"; $message .= "<p>Hello,<br>This is a test email, the text/html version.</p><p>Regards<br><strong>Maggie Multipart</strong></p>"; $message .= "\r\n\r\n--" . $boundary . "--"; mail("", $subject_line, $message, $headers); header("Location: ./?success=email-sent"); exit(); // var_dump($_POST); ?>
텍스트/일반이 캐릭터 세트 = UTF-8
안녕하세요,
이것은 시험 이메일, text/plain 버전.
감사
매기 여러 부분이
그러나, EM은 (그리고하지 너무 자주) HTML 이메일을 수신하도록 설정되어있다. 누군가이 문제를 해결하도록 도와 줄 수 있습니까? 헤더가 누락 되었습니까?