-3

Is there an easy way to send an email through an HTML page? It would be something like this. We're in an intranet, so I don't know if it's possible to setup the SMTP server and password. When I tried the example above, I get the popup window to install Outlook.

I tried using How to send an email from JavaScript, but I think I'll have the same limitations as the solution above.

The email will essentially be between two email addresses in the intranet (ie. joe@Company.com -> bob@Company.com).

In asp.net it can easily be done, but I just wanted to create a simple form in the meantime.

Thanks.

fdkgfosfskjdlsjdlkfsf
  • 3,165
  • 2
  • 43
  • 110

1 Answers1

1

Is there an easy way to send an email through an HTML page?

Easy? Yes.

The mailto: URL scheme.

<form action='mailto:foo@example.com'

However, it is highly unreliable, to the point where it is not sensible to use it on the open web and usually more effort then it is worth to ensure that all clients on an intranet support it.

In asp.net it can easily be done

Server-side solutions are the only sensible approach.

Third-party hosted solutions do exist but on an intranet it should be very easy to get the required server-side environment available.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • I'd note that `mailto:` requires an email client installed or some kind of [Web-based protocol handler](https://developer.mozilla.org/en-US/docs/Web-based_protocol_handlers) needs to be registered in the user agent. Even then, spotty at best. – zero298 Nov 08 '17 at 20:44
  • @zero298 — Not just any email client though. I left the specifics of how it was unreliable to the page behind the link. – Quentin Nov 08 '17 at 20:45