以下のリンクからこのコードを使用して、Excel ファイルを添付ファイルとして送信しました。
http://www.hotscripts.com/forums/php/22626-php-form-excel-then-send-email-attachment.html
これが私が使用したコードです:
<?php
ob_start();
?>
<html>
<head><title></title>
</head>
<body>
<body>
<center>
<table>
<tr>
<td>Name:</td><td>My Name</td>
</tr>
<tr>
<td>Address:</td><td>My address</td>
</tr>
<tr>
<td>Gender:</td><td>Female</td>
</tr>
</table>
</body></html>
<?php
$FILE_CONTENTS = ob_get_contents();
ob_clean();
// include the class
include("../includes/classes/class.mailer.php");
$recipient = "myid@domain.com";
$from = "myid@domain.com";
// subject
$subject = "Subject of email";
// email message
$message = "
Here goes the message.
";
$myEmail = new EPDEV_Emailer($recipient, $from, $subject);
$myEmail->addText($message);
$myEmail->addFile("my.xls", "application/vnd.ms-excel", $FILE_CONTENTS);
$myEmail->send();
?>
メールでExcelファイルを受け取りましたが、通常のExcelファイルに含まれている行がファイルに含まれていません。しかし、Excelファイルに含まれている行を含むファイルが必要です。誰が問題が何であるかを私に提案できますか。
前もって感謝します