やりたいのは送信をおしたら、サーバーの中でcsvが作成され、飛んできたメールの中にzipファイル(csvの)が添付されているとのことですが、今はメールがきて、csvも作成されるが、ファイルが添付されていないです。そしてブラウザ上ではエラーが表示されています。
回答よろしくお願いいたします。
エラ文はこちら↓
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, support@sakura.ad.jp and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
php
1 mb_language("Japanese"); 2 mb_internal_encoding("UTF-8"); 3 $filepath = "【csv/text.zip】"; 4$boundary = "__BOUNDARY__"; 5 6$additional_headers = "Content-Type: multipart/mixed;boundary=\"" . $boundary . "\"\n"; 7$additional_headers .= "From: xxxxxxx"; 8 9$message = "--" . $boundary . "\n"; 10 11$message .= "Content-Type: text/plain; charset=\"ISO-2022-JP\"\n\n"; 12$message .= "csv/text.zip\n"; 13 14$message .= "--" . $boundary . "\n"; 15 16$message .= "Content-Type: " . mime_content_type('text.zip') . "; name=\"text.zip" . basename($filepath) . "\"\n"; 17$message .= "Content-Disposition: attachment; filename=\"text.zip" . basename($filepath) . "\"\n"; 18$message .= "Content-Transfer-Encoding: base64\n"; 19$message .= "\n"; 20$message .= chunk_split(base64_encode(file_get_contents($filepath)))."\n"; 21 22$message .= "--" . $boundary . "--"; 23 24 25 26 $to = "xxxxxx"; 27 $title = "ご無沙汰しております"; 28 $message = "$moji\n"; 29 $from = "From:xxxxxxxxxxxxx\r\n"; 30 $from .= "Return-Path: xxxxxxxx"; 31 $send_mail = mb_send_mail($to, $title, $message, $from, $additional_headers); 32 if ( $send_mail ) { 33 echo "送信完了"; 34 35 } else { 36 echo "メールを送信できませんでした。"; 37 38 } 39 40?>
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/11/30 07:53