dongzhuxun5136 2009-10-08 03:35
浏览 77

MIME错误 - 在发送电子邮件时接受MIME类型

The following script works (almost) just as I want. This project is so near completion with one small problem. In the email message I get the following: "If you can see this MIME then your client doesn't accept MIME types! --jacquie1003"

This is being sent through Novell GroupWise. I have included the mail script and the resulting email. The email arrives with the attachment and everything seems good except that error message. See the message body below.

The users are completing a form with approximately 95 fields. When they submit a validation is done on mandatory fields. If everthing is complete the completed form is presented to them in the same window, a file is created, and the email is created and sent (with the created file as an attachment) to one of five preset recipient groups.

What am I doing wrong in my mail script. Any help would be greatly appreciated. At this point I am not looking to use PEAR, PHPmailer, Zend, etc... unless I absolutely have to.

I apologize in advance for some of the formatting of my cut-and-paste. Thank you in advance

beginning of mail script

<pre>$head_division = $_POST['head_division'];
$category = $_POST['category'];
$fname = $_POST['fname'];
$lname = $_POST['lname'];

$FilePath = "c:\\temp\esumes\\";
$FileName = $officer_pr . "_" . $inc_number . ".html";
$ResumeFile = $FilePath . $FileName; 

$to = $fname . "." . $lname . "@tucsonaz.gov";
$from = $fname . "." . $lname;
$subject = $head_division . " Divsional Resume (Test)";

$bound_text = "jacquie1003"; 
$bound = "--".$bound_text."
"; 
$bound_last = "--".$bound_text."--
"; 

$header ="From: " . $from . "@tucsonaz.gov" . "
";  
$header .="MIME-Version: 1.0
";
$header .="Content-Type: multipart/mixed; boundary=\"$bound_text\"";
$message = "If you can see this MIME then your client doesn't accept MIME types!
"
.nl2br($message)
.$bound;

$message .= "Content-Type: text/html; charset=\"iso-8859-1\"
"
."Content-Transfer-Encoding: 7bit

"
."Please see the attached resume file.<br /><br />"
."<strong><u>Incident Summary</u></strong><br />"
."<strong>Case Number:</strong> " . $inc_number . "<br />"
."<strong>Category:</strong> " . $category . "<br />"
."<strong>UCR:</strong> " . $ucr . "<br />"
."<strong>Location:</strong> " . $inc_street . "<br />"
."<strong>Date:</strong> " . $inc_date . "<br />"
."<strong>Time:</strong> " . $inc_time . "<br />"
."<strong>Officer:</strong> " . $officer . "&nbsp/&nbsp" . $officer_pr . "<br />"
.nl2br($message)
.$bound;

$file = file_get_contents($ResumeFile);

$message .= "Content-Type: text/html; name=" . $FileName . "
"
."Content-Transfer-Encoding: base64
"
."Content-disposition: attachment; file=" . $ResumeFile . "
" 
."
" 
.chunk_split(base64_encode($file))
.$bound_last;

mail($to, $subject, $message, $header);
</pre>

end mail script

Email message

Please see the attached resume file.

Incident Summary

Case Number: 0910071139

Category: Matters of Concern COT

UCR: 04.03

Location: 1310 W. Miracle Mile

Date: 10-07-09

Time: 1505

Officer: Smith / 13785

If you can see this MIME then your client doesn't accept MIME types!

--jacquie1003

End of Email

  • 写回答

2条回答 默认 最新

  • doulan4939 2009-10-23 14:32
    关注

    Try taking off your boundary. Not sure if it'll help, but I'm having a similar problem and when I add then it prints part of the attachment.

    评论

报告相同问题?

悬赏问题

  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 MATLAB中streamslice问题
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序