Idea: using a URI for sending email

In order to send an email over SMTP, you need 2 sets of information:

On the other hand, you have the HTTP GET format where you can put everything you need to execute the request in 1 string:
http://james:password@www.example.com /hr /request /?type=holiday&start=2004-11-22&end=2004-11-24
No need to save the ‘server/port’ data separate from the ‘request’ location or from the actual content.

Which inspired me to a similar format for sending email:

smtp://[username[:password]]@server[:port] /from:address [/subject:text] [/to:address] [/cc:address] [/bcc:address] [?[subject=text] [&message=text] [&to=text] [&cc=text] [&bcc=text] [&attachment=file]]

Some examples:

Keep in mind: a URL is typically limited to 255 characters (depending on implementation), and a querystring (the part after the “?”) is limited to 4KB.

The advantages of this system?

  1. you can specify a complete email in 1 single text string (with size limitations)
  2. one could easily specify a lists of emails to be sent (e.g. a text file with 1 email per line), and use different SMTP servers for some of them (e.g. send the Hotmail/MSN ones directly to mx?.hotmail.com for speedy delivery)
  3. it can be interpreted by the SMTP client (email sending application), that translates it into a regular SMTP conversation (HELO ... MAIL FROM ... RCPT TO ... DATA)
  4. it could easily be accepted by a web server, that accepts the URI with the smtp:// replaced by http://. One could send an email by just clicking on a link in a browser. The server would of course not accept these requests from anyone, otherwise it would be an easy spam machine. But one could send emails with cURL or WGET. How about that?
  5. if a company stores all sent messages on a special server, you could have a search-within-your-emails-site with +- the same URI format:
    http://peter:password@searchmail.example.com /from:peter@example.com /?subject=*contract* &notbefore=2004-11-15 &notafter=2004-11-20 &to=*robert*
  6. One could also adopt smtps:// for SMTP over TLS.

If anyone can do something useful with this, be my guest!

💬 idea 🏷 email