1

I have read a lot of pages about avoiding the mailto length limit, but I haven't found an answer to my issue.

My problem is that I cannot send mail from the server (with PHP) because the employees have to keep a history of their emails on their private mail box.

I have to open the mail software client with some fields that are filled, after selecting one type of email. My select looks like like this :

<select <!-- ... --> onchange="sendMailClientSide(this.value);">
    <!-- ... -->
</select>

and my javascript function :

function sendMailClientSide(refType) {
    // ...
    var dest = "test@domain.ty";
    var subj = "Why this doesn't work ?";
    var body = /* a very big body */;

    var linkMailto = "?bcc="+dest+"&subject="+subj+"&body="+body;
    document.location.href = "mailto:"+linkMailto;
    // ...
}

For some mails types, this works perfectly.
But with a body more larger than 1400 characters, the client software doesn't open.

I have tried submitting HTML form too. With this method, the limit seems to be highter but it still has a limit because it fails with a bigger mail. And finally, I tried cutting the body (something like this "&body="+body1+"&body="+body2+...) but it doesn't work.

Anybody know if a Firefox plugin exists to expand the mailto size ? Or something like this (something from client side) ?

Glenn Slaven
  • 33,720
  • 26
  • 113
  • 165
Totinette
  • 31
  • 1
  • 7
  • 1
    Send from the server with a BCC to the originator? – Alex K. Nov 29 '11 at 17:07
  • It could be related to the length of the URL - see this SO question: http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url – Barry Kaye Nov 29 '11 at 17:12
  • @Alex : I thought at this option but I want that mails are directly at the send mail box. – Totinette Nov 30 '11 at 09:54
  • @Barry : All of employees are using Firefox (8.0), and as I use javascript, everything is client side, isn't it ? So, the URL limit should be > 60 000 chars (and not "just" 1400 for me) – Totinette Nov 30 '11 at 11:20

1 Answers1

1

I don't think that it is directly possible. Maybe with a plugin, as you already suggested.

My workaround would be to provide the user with a simple form which submits to the server which then sends the mail out directly (without opening the clients mail program at all). Thus you can easily avoid the size limit at all.

The problem with this would be, that the user don't have their known email interface and thus special text formatting, custom signatures and stuff like this won't work.

You would have to decide this based on the formatting needs and who is the recipient.

dplante
  • 2,445
  • 3
  • 21
  • 27
ZeissS
  • 11,867
  • 4
  • 35
  • 50
  • So the problem is the transmission of the email between Firefox and the client mail. My only chance is to develop a program (in C/C++ language) to parse a file with a special extension (for exemple file.contentMail) and launch the client mail. Of course, each of the employees will have to install this software and associate the opening of this type of file in Firefox parameters. – Totinette Nov 30 '11 at 10:29
  • @Totinette: Yeah, if you are really required to use `mailto:`. I really would suggest to send it off from your mail server. – ZeissS Nov 30 '11 at 21:40