I have several forms that get completed, then sent using the mail function in PHP as Excel documents. I use the following code to do so:
mail($recipient, $subject, $content, "From: $email\r\nReply-To: $email\r\nX-Mailer: JJ_formmail\ncontent-type: application/vnd.ms-excel\nContent-Disposition: filename=membership.xls");
Most times this works fine, but other times it sends garbled information in the body of the email, with no attachment. Is there a better, more consistent way to do this? Also, when send the email in this way, the email body is blank (since the body is being sent as the attachment). Is there any way to have both the attachment and text within the body of the email? Thanks very much for any and all suggestions and ideas!