Is there any way to send an e-mail in html and not using php in it ?

Dani AI

Generated

A concise, up-to-date addendum to this 2013 thread: asked whether HTML alone can send mail. As and noted, plain HTML cannot perform a server-side send — the only built-in option is the mailto: URI which launches the user’s email client rather than delivering mail itself. For an automatic, reliable send you need either a hosted service or a server-side component. (rfc-editor.org)

If you want to avoid writing PHP yourself, there are two common, maintenance-light approaches. First, “form-to-email” services (for example, Formspree) accept an HTML form POST and forward submissions to an inbox — great for static sites and prototypes. Second, some static hosts provide built-in form handling (Netlify Forms, etc.) that capture posts at deploy time and forward or store them. Both remove the need to run your own mail-sending process, but watch quotas, privacy, and how they let you brand/verify the sending domain. ()

If you need more control (templates, attachments, volume, analytics), add a tiny serverless endpoint or microservice that receives the form and calls an email API (SendGrid, Mailgun, Amazon SES). Keep API keys on the server side — never embed them in client JS. Minimal client flow example:

fetch('/api/send', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ name, email, message })
});

The server then authenticates and calls the provider’s send API. (twilio.com)

Practical cautions: set up SPF/DKIM/DMARC or provider domain authentication to avoid spam filtering and “via” labels; allow DNS propagation time; add spam protections (honeypot, CAPTCHA, rate limits); and test across clients. Providers’ docs explain domain verification and deliverability best practices. (support.sendgrid.com)

Recommended Answers

All 4 Replies

I will give you a simple answer, no. HTML is a markup language which means it's only used to present data, it is not capable of actually taking out actions.

With HTML alone, its not possible. You need to have access/include some scripting.

I'll be the one to give you the answer that you want to hear :)

There are email services out there (some free, some very low cost) that will handle sending the email for you, and all you need to do is copy/paste one of their HTML-based forms onto your website.

Tnx so much

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.