a valid alternative to mailto? - html

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.

Related

Alternative to mailto: to link email

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.

Link to mail server from website

I have an email page on my website with a form and tinyMCE and all that fancy stuff, but I also want to add a couple of links to the popular mail servers such as gmail, yahoo, and hotmail.
I've seen some links that go to the my Microsoft Office Outlook (which I never use), and I've also seen a gmail link that opens up gmail in a new tab with a form already open and a mailto: value already given. Just wondering how this is done if I, lets say, have a mailto: value to send and perhaps a subject and message.
Just to make it clear, I want three or four image links on my page, each one for a different mail server (gmail, yahoo...) and when clicked on, it opens a form partly filled out (a mailto:value and possibly a subject and/or message) fullscreen. Thanks.
It's not going to be easy, as you'll have to integrate with each one of these services. How about going at it a different way? For GMail (at least on Chrome) you can figure the web app as the handler for your mailto: links. With that, you can create a link that opens GMail, optionally with subject and body filled in. See RFC2368 for details, or try this link.
Most users don't have accounts on all of the web mail services you mentioned anyways, and using the mailto link allow the mail to the sent using the user's default e-mail client (may it be Outlook, or GMail) which most people prefer anyways.

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

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.