tags:

views:

53

answers:

4

Hi all, i have an application that have to return emails to user his email client, but on some cases i have to pass around 1000 emails...

I'm using mailto on href, something like this:

mailto:[email protected][email protected],[email protected],anotherone@dfsf...

Why am I returning to his email client instead using PHP mail() function?
Because the user sender email depends on witch computer he is logged, and he needs to archive thoose emails...

The problem: Some browsers, if the email list is bigger than X, it won't send to his preferred email client...

Can anybody help me on this?

Thanks in advance

+6  A: 

You could output the full BCC list and ask the user to copy-paste it in. But maybe you should just rethink your entire strategy if you want to pass thousands of e-mail addresses to a user.

Matchu
i've made a button that generates all emails and copy them to user's clipboard. ;) thanks
CuSS
A: 

Passing a user thousands of email addresses is very unusual.

Generally, a more typical application would use PHP mail() on the server side, and then allow browsing the archives of whatever notifications have been sent out. The mail stays on and is sent from the web server, but allows the user to see what's gone out in the past.

On the minus side, that's a good bit more code, but probably the only way to fix the problem you're having; mailto: wasn't meant for large volume.

Dean J
read "Why am I returning to his email client instead using PHP mail() function?"
CuSS
You can figure out which computer they're sitting at in other ways; look up "php get client hostname" for example. The emails are still archived, on the server, where they can get to them later.
Dean J
+1  A: 

That's because the length of a GET request (and such a link is a GET request) has a maximum. On some browsers it might only be 2083 characters. So any email address behind that limit will not be send to the client email program. And thousand of email adresses will break the limit.

Kau-Boy
+1  A: 

For anything other than a simple mailto:address with no parameters, mailto: URLs are massively unreliable and should be avoided. URL-length issues are only the beginning.

on some cases i have to pass around 1000 emails...

Even if a mailer could cope with getting the URL, a user's residential ISP is unlikely even to allow them to send that.

Give up. Send the mails yourself from PHP. Send a copy to the user for the archival purposes.

bobince