3.1 emailing invoice as pdf problem

Hello,

i have a problem when using the build-in option to email an invoice.

To some persons the invoice is delivered correctly as an attachment, to others (me for example), there is no attachment and the pdf is shown encoded in the body of the email as shown below.
In hotmail I see a pdf attached but with 0KB and when i try to open it i get an error and the pdf is empty. :unhappy:

I’m using dolibarr 3.1 stable and phpmail.
I also tested from the online demo (dolibarr 3.2 alpha and phpmail) and it gives the same problem.

MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=“32ab9a289c3a8b1870d34970746df494”
Content-Transfer-Encoding: 8bit
X-attachments: FA2012-016.pdf
X-Spam-Processed: xxxxxxxxxxxx, Wed, 01 Feb 2012 21:49:39 +0100
(not processed: spam filter heuristic analysis disabled)
X-MDRemoteIP: 195.225.164.226
X-Return-Path: xxxxxxxxxxxxxxxxxxxxxxxxxxxx
X-Envelope-From: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
X-MDaemon-Deliver-To: xxxxxxxxxxxxxxxxxxxxxxxxxx
Return-Path: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
X-OriginalArrivalTime: 01 Feb 2012 20:49:40.0931 (UTC) FILETIME=[04E7D930:01CCE123]

–32ab9a289c3a8b1870d34970746df494
Content-Type: text/plain; charset=UTF-8

Veuillez trouver ci-joint la facture FA2012-016 n nCordialement n n

–32ab9a289c3a8b1870d34970746df494
Content-Disposition: attachment; filename=“FA2012-016.pdf”
Content-Type: application/pdf; name=“FA2012-016.pdf”
Content-Transfer-Encoding: base64
Content-Description: File Attachment

JVBERi0xLjcKNiAwIG9iago8PCAvVHlwZSAvUGFnZSAvUGFyZW50IDEgMCBSIC9MYXN0
TW9kaWZpZWQgKEQ6MjAxMjAxMjQyMDIwMDQrMDEnMDAnKSAvUmVzb3VyY2VzIDIgMCBS
IC9NZWRpYUJveCBbMC4wMCAwLjAwIDU5NS4yOCA4NDEuODldIC9Dcm9wQm94IFswLjAw
IDAuMDAgNTk1LjI4IDg0MS44OV0gL0JsZWVkQm94IFswLjAwIDAuMDAgNTk1LjI4IDg0

and so on…

Did I miss something or is this a bug?

Can anyone help me?

what program that you used for sending email? on linux or windows?

It’s running on a linux server (on a shared hosting).
Do I need to ask for specific settings for phpmail?

yes confirm with your hosting about send mail php

Can you provide the part after the @ of the recipient of email ?

I tested some different email addresses:

the following gave me problems
hotmail.com
telenet.be

following (hosted at the same company) worked
belleetbeau.be
2trees.be

I got the same results with my dolibarr 3.1 (stable version) as the demo version (at demo.dolibarr.org)

Salut Eldy,
Same problem here when upgrading from 3.0 to 3.1
We’re on a Mac OS X 10.5 Leopard Server, using the built-in PHP mail function.
With only a few sends, we have so far failed reports from three Mac and one laPoste.net recipients (they see attachments as garbage) whereas a windows/exchange recipient had no problems.

So far the documents are invoices, orders and proposals, with the crabe, azur and muscadet models, so it seems quite general in the attachment process rather than in a specific module.

Do contact us if we can help
Merci,

Franck Horlaville
TAM Software

A version 3.1.1 will be released soon. It will include an option called
MAIN_FIX_FOR_BUGGED_MTA
that should solve your problem.

Hello Eldy,

I did the upgrade from 3.1.0 to 3.1.1.
I tested mailing a pdf invoice and it does not work yet. Do I need to activate MAIN_FIX_FOR_BUGGED_MTA?
I have been looking for it, however I can’t find how to activate the “hidden option MAIN_FIX_FOR_BUGGED_MTA to fix bugged MTA.”

To enable this option, go into home - setup - other, add a new entry with parameter name = MAIN_FIX_FOR_BUGGED_MTA and value = 1 and click “Add”.

Also, if you can, use the second method of 3.1.1 version to send email (SMTP/SMTPs) that does not use the native php function and should works in every case.