|
Posted by Rik on 10/25/06 03:42
Shelly wrote:
> I am looking for suggestions for the best way to do this. I can hack
> it out to make it happen, but I thought I would make use of the
> expertise to do it the best way.
>
> I have a form with a drop-down list of users. I want to use a button
> to send mail to the user that is currently showing in the drop-down
> list. When this button is pressed, I want the user's default email
> program to come up with the email address of that person filled in.
> (the email addresses are in the database and can be retrieved easily).
>
> I can go to the process of having a separate mail form with a text
> box and gathering all the info and then using mail() to send it. Or,
> I can have the button exercise some code that runs separate window
> and exercises a mailto in the html area with the address filled out
> and then kills the window, leaving the user's email reader up there.
>
> Both seem rather cumbersome. Is there an easier way?
No.
Either use javascript for a emulate a click on a 'mailto:' link, which is
highly unreliable, or use a form. That would not neccesarily require
another page, just another textarea & button.
Even if (and that's a big if) the UA will grant the 'mailto:' option, there
is no way to know for sure this UA:
1. Knows which is the default email-program.
2. Succeeds in opening the emailprogram.
There is another way: give the users emailadress, and let them open their
emailclient themselves.
--
Rik Wasmus
[Back to original message]
|