Alternative to mailto: to link email - html

I am creating a website and there is a page with people that are part of the company. Each person has an email that i want for the user to be able to get the email for the person that he/she want.
If we were in 2011 i would have used mailto: html tag. But really not so many people are using desktop email clients.
I thought about linking to a link so a new window would open in gmail and a new message would be created with recepient the pressed email. BUT not everyone uses gmail.
The only posible "solution" that i though that when the user clicks on the email this would be copied automatically in the clipboard. It would have the same result as doing CTRL & C at something. BUT this requires a lot of time and i dont want to get my hands dirty with javascript.
Is there any other way to do this ?

You should probably still use mailto:. mailto: is not intended for just desktops, it identifies a handler for the client. A mobile device would be able to recognize it just as well, and launch its preferred MTU.

With a lot of addons like smartaddon contact form and foxyform available out there, you could add them to your html code.
But, if you could use php, it to would just take few statements of code to set up the contact form on your own. Refer this post which explains clearly on how to set up your contact form using php.

Related

a valid alternative to mailto?

I maintain a site for an organization that contains 80+ contacts. when I created this site I used mailto: to allow people to contact the required individual, which worked fine until just recently.
Now I find that when I click on the email link nothing happens or, as in my case, since I have MS Office, Windows tries to load Outlook which I don't want. This is also affecting anyone browsing the site, I am receiving numerous notices that the email links are broken. I know the addresses are valid because I can copy the address and send it manually with no problems.
I've searched the web and it seems that everyone recommends to NOT use *mailto:* and use to a form contact method, however, I am confused, I can figure out how to setup a contact form for one individual, I'm having a problem about how I would sync 80+ contacts to one Contact page.
I would really appreciate anyone who could point me in the right direction. The site in this case is [http://s-a-m-s.org/contact.php][1]
Thank you;
Greg
Specifying an e-mail address in an anchor elements href attribute (<a href="mailto: user#domain.com">) to send e-mail is not a guarantee of sending e-mail.
The protocol mailto is user agent-specific which means that users with different browsers or devices will most definitely not have your desired outcome.
HTML is rendered by the clients browser which means that you can not control how your mailto protocol is being handled.
If you want to guarantee that your contacts can be contacted through your website you would have to resort to using another programming language.
You could then (for instance) loop through all your clients and build a contact form for each of your organisations contacts which the server would then send e-mails to. Contact your local developer to help you out with more specifics if HTML is your limit.

Link with mailto when the user doesn't have an email handler?

So,
Imagine that I have this link:
Test
How do you deal with people that visit your site and don't have any email handler? What are the possible solutions? Like showing the email, for example? Any other solutions?
Thanks
EDIT: This solution requires you putting the email in between the anchor links. Why would you not?
I would not worry about it. Most browsers (all modern ones) would allow a user to right click and copy the email to their clipboard in the worst case. Its not such a mission critical feature that I would worry about it. If they do click it, I believe the browser will ask the user what mail client they would like to associatemailto links to.
The only other choice would to allow them to fill out a form that your mail server will generate into an email and then send to the appropriate recipients.
On mouse over it could show a tool tip above the link with the email?
If you don't want to be dependant on client settings, you ll need to provide the service server side. Meaning allow ppl to send an email from your site using some simple text box and a SMTP plugin.
You might find this question helpful: Has anyone ever come up with a way to detect the email program a recipient is using?
Essentially, there's no possible way to check if there's an outside program to handle email, so short of writing a submission forum that automatically sends the email to the intended recipient, there's probably not much you can do.

Provide a link to allow users to email our company even if they do not have outlook/outlook express installed

We want to put a link on our site "Subscribe", when you click this link this is the href
href="mailto:subscriber#org.com&subject=i want to subscribe?body=whatever"
This works great, it's super easy too, but the problem is for anyone who does not have outlook/outlook express installed.
Without real development of any new features is it possible to make this work for gmail/yahoo/aol/etc.... email users?
The mailto URL scheme works in all browsers and only in email clients that support it.
In essence, when clicked it will launch the default email client on the computer and set the to address, subject and body.
You can't make it work in a web based email client, since they can't be set as default email clients.
The action that takes place when a user clicks on a "mailto" link is end user dependent.
There's no way with HTML to determine whether or not a client has Outlook or other client apps installed.
You can sidestep all email clients/webmail services if you instead have a form for submitting messages, with a place to put the email address the company should reply to. A simple CGI or PHP script can turn that to an email on the server side.
This page has a PHP example. http://www.w3schools.com/PHP/php_mail.asp

Embed HTML form in email

Can I send an email that contains an HTML form with one combobox, that upon changing the value a reply would be send back?
From the research I've made it seems that it is not possible...
http://en.wikipedia.org/wiki/HTML_e-mail
Is that true?
Thanks,
Eden
Yes it is possible.
But there are restrictions.Different mail clients and web mails behave in different manners.
For example, Yahoo web mail, upon submitting form brings up a dialog box which warns about sending some info outside Yahoo. You have to disable Javascript if you want your submission work properly, otherwise it doesn't send submit buttons by REQUEST (POST or GET).
In outlook express I checked and it works without any problem.
Because of this problem, I think it isn't recommendable to do form embedding inside email. I suggest to make a web form and send a link to it via email. Although by this approach you may lose some lazier users, but it seems that lose will be lesser than lose arising from problems of email embedded form submission.
Yes that is true. It is not possible. What you can do is provide a link to a webpage and do the combobox action on that website.
You can create a form in google docs and share it via 'email', I have tested it and it shown inline at-least in gmail.
https://docs.google.com/forms

mailto: links and webmail

Is there a way to implement a mailto: link that works with webmail clients?
Edit - so a traditional mailto link is (as I suspected) not going to work. So has anyone seen anything similar to those rss buttons you see with a variety of the most popular sites on?
The links are handled by the user's browser. GMail has a client-side install (GMail Notifier) that lets you specify that you want GMail to handle all mailto links.
But there's no way for a web page to specify that it's mailto link should be handled by a webmail app (even if it could, how would you know which one?).
That's really more of a web client issue, it's already available for Firefox:
http://starkravingfinkle.org/blog/2008/04/firefox-3-web-protocol-handlers/
but ultimately it's down to the user to decide how their browser handles mailto links.
Create a text file named MailtoWebMail.reg with the following content...
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\mailto\shell\open\command]
#="\"(BrowserExecutable)\" (Parameters)"
where (BrowserExecutable) is replaced with the complete path to your browser (ie. C:\Program Files\Internet Explorer\iexplore.exe)
and (Parameters) is replaced with the appropriate line for the mail service as described below...
GMail
"http://mail.google.com/mail/?view=cm&fs=1&to=%1"
Hotmail
"http://hotmail.msn.com/cgi-bin/compose?To=%1&mailto=1"
Yahoo Mail
"http://compose.mail.yahoo.com/?To=%1"
Netscape Mail
"http://webmail.netscape.com/compose.adp?mailto=%1"
Mail.com
"http://mail01.mail.com/scripts/mail/Outblaze.mail?composeto=%1&compose=1"
Opera Web Mail
"http://mymail.operamail.com/scripts/mail/Outblaze.mail?compose=1&did=1&a=1&to=%1"
Note: There should not be a blank line after the [HKEY_LOCAL_MACHINE] line
MikeB
I am just brainstorming here. You might be able attach a Javascript handler to the link that asks the user if s/he wants to login to a webmail account (along with a list of providers). If you have the correct URLs for the webmail providers, you would then be able to invoke them on the basis of the user's choice. If the user answers no, return true from the handler and presumably the link would work normally.
See, for example, http://toric.blogspot.com/2005/07/gmail-compose-link.html and http://blog.monstuff.com/archives/000238.html
Here are 2 Opera UserJS examples that you can inspect to give you and idea of how you can do it on a regular pages. (Obviously, UserJS-specific functions wouldn't work in a regular page, but you can use regular events.)
This one catches left-clicks on mailto links and opens them in Gmail for example. It can also handle forms.
http://shadow2531.com/opera/userjs/BeforeMailtoURL.js
This one catches all mailto actions, has a more generic parser (that supports any hname and not just to, cc, bcc, subject and body) and has a better format string syntax:
http://shadow2531.com/opera/userjs/BeforeMailtoURL.zip
Basically, you have to find a way to intercept mailto link actions. You can do this with click event listeners on links and submit listeners on forms (if you really want to support forms). (It's easier to use a click event listener on the whole window and just filter it to find mailto actions. That way, you catch mailto links that are dynamically added at some arbitrary time.)
Or, you can just run through the page and process all the mailto links.
But, if you want to intercept mailto actions in the address field, via window.open or document.location etc., you'll need something like HTML5's registerProtocolHandler or something like Opera's webmailprovider.ini support. You can use registerProtocolHandler in Firefox, but by default, it's restricted to the domain you set it on.
So, basically, you either convert mailto links to http(s) webmail compose URIs up front, or at the time the mailto action is invoked. The latter works much better.
Converting a mailto link to a webmail compose URI involves a few things. First, you need to know what query string variables the webmail accepts. Then, you need to parse the mailto URI to split it up into the parts you want. Then, you need to decode and re-encode (to normalize) those parts. Then, you need to join multiple occurrences of hvalues together. And, you need to handle things in a case-insensitive manner and check for and escape unsafe characters and %HH etc.
For the parsing, you can do a quick and dirty regex, but you'll get better results with a full mailto URI parser and normalizing functions.
So, if you just want to handle left-clicking on links, you can do that cross-browser. For more than that, you have to use any hooks the particular browser gives you.
Hypothetically, assuming the webmail client passes arguments through the authentication process (or the user is already authenticated), I don't see why this is so impossible. It can't be done in the simple mailto: way, but it'd be possible to provide a selection of links to popular webmail services and use Javascript to intercept clicks on mailto: links such that the user is presented with a drop-down list of possible webmail services (or their local email client). The links would carry the To:/Subject: address but formed in whatever structure that webmail service requires.
If you're using a Google Apps email account (hosted email), than Gmail Notifier will not work. You can use a bookmarklet though, to change all of your mailto: links to links that point to your webmail.
Here's a bookmarklet I wrote to do just that, it will highlight all fixed links in red.
javascript:for(var i=0;i<document.links.length;i++){var a=document.links[i];if(a.href.indexOf('mailto:')==0){a.href='http://mail.google.com/a/sample.com/mail?extsrc=mailto&url='+a.href;a.style.backgroundColor='red';a.style.color='white'}};return true;
Just be sure to change http://mail.google.com/a/sample.com to whatever the proper hosted address is for you.
I suppose this will work with a number of other email clients if you just change that link around.
Kind of an old thread, but nobody has quite answered it yet, so here goes.
As blesh nearly says above, while there's no way to get "mailto:" to go to Gmail, there's another way to skin this cat that works just fine in many situations. Just change the URL. Remove the "mailto:" prefix and insert "https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=".
This seems to work like a charm, whether or not the user is coming in through Google Apps. If the user is not logged in, he'll be walked through that step, and then Gmail will still kick off a new message. The only downside I've noticed is that if (when?) Google decides to change their bookmarking scheme, this may need a bit of tweaking.
It may make sense to perform this transform either before or after the URL is in the DOM, depending on your situation.
Oh and double click the MailtoWebMail.reg to insert the command into your registry.
MikeB
Has anyone seen numbers indicating what percentage of webmail users have configured their systems with plugins etc. to properly have mailto: links sent to their browser / webmail system rather than to a desktop app? This seems critical in deciding whether to use mailto: links on a site or a contact form, but I'm having trouble coming up with numbers to guide the decision.