For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > September 2004 > Mailto delimiters









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Mailto delimiters
Ken Elder

2004-09-30, 2:56 am

I have a PHP script that creates a string of e-mail addresses from a MySQL
table and puts those e-mail addresses into an XHTML <a href="mailto:___">
tag. I'm having trouble figuring out what kind of delimiter to use between
e-mail addresses so that the resulting addressed e-mail message works with
AOL, Outlook, and other e-mail clients.

When I separate the addresses with semicolons, it works with Outlook but not
with AOL.


When I separate the addresses with a comma and a space, it works with AOL
and with not with Outlook unless Outlook Tools > Options > Preferences >
E-mail Options > Advanced E-mail Options is configured to "Allow comma as
address separator" (which I don't believe is the default).


When I separate the addresses with a comma and no space, it doesn't even
work with Outlook configured to allow commas.


What should I use as a delimiter so that the mailto string will work with
all e-mail clients? If there is no such delimiter, what technique can I use
to get around that problem?


Ulrich Nehls

2004-09-30, 11:30 am

Hi Ken,

> What should I use as a delimiter so that the mailto string will work
> with all e-mail clients? If there is no such delimiter, what
> technique can I use to get around that problem?


Its hard to predict how to make it work on *all* kinds of mail clients
(who knows all of them ? :-), but maybe the best choice would be to
convert your files to *.ldif address books. (ldif stands for 'ldap
interchange format' .. ldap stands for 'leightweight directory acces
protocol' ..). *.lfid can handle mail lists also.

Maybe you'd import your csv file to a Mozilla or Thunderbird mail client
and re-export it as *.ldif address book. I have no idea whether AOL can
handle this, but it's worth a try.

Regards,

Uli
Nikolai Chuvakhin

2004-09-30, 4:03 pm

"Ken Elder" <kenelder@cox.net> wrote in message
news:<q0L6d.5623$Tj.156@okepread02>...
>
> I have a PHP script that creates a string of e-mail addresses from a MySQL
> table and puts those e-mail addresses into an XHTML <a href="mailto:___">
> tag. I'm having trouble figuring out what kind of delimiter to use between
> e-mail addresses so that the resulting addressed e-mail message works with
> AOL, Outlook, and other e-mail clients.


I believe you are trying to accomplish something that the standards
do not allow.

The HTML specification says:

12.2 The A element
....
Attribute definitions
....
href = uri [CT]
This attribute specifies the location of a Web resource, thus
defining a link between the current element (the source anchor)
and the destination anchor defined by this attribute.

http://www.w3.org/TR/html4/struct/links.html#h-12.2

In other words, mailto must be a valid URI. Now what is a valid
URI? The HTML specification says:

6.4 URIs
This specification uses the term URI as defined in [URI] (see
also [RFC1630]).

http://www.w3.org/TR/html4/types.html#type-uri

And RFC1630 clearly says:

Mailto

This allows a URL to specify an RFC822 addr-spec mail address.

http://www.ietf.org/rfc/rfc1630.txt

Note the singular "address". Apparently, a mailto URI can only
define a single address.

> What should I use as a delimiter so that the mailto string will
> work with all e-mail clients?


Nothing. Mailto is not supposed to work with multiple addresses.

> If there is no such delimiter, what technique can I use
> to get around that problem?


Replace <a href=" mailto:address1,address2,address3,addres
s4">
with <a href="mail.php?to=address1,address2,address3,address4">
and write a mail script that would take input from a form and
mail it to the specified addresses using the poster's e-mail
as return address.

Cheers,
NC
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com