Hello I want make my website able to do simple function as sending email to any email address I want. I know how to do it in webiste host within my PC and there are plenty instructions, However if i want to do the same thing wihin website host within raspberry pi is there any different? it's pretty hard to find some article talked about. for example if I want use this instruction :https://medium.com/@WebReflection/how-to-send-emails-from-static-websites-9a34ceb9416c is there something i need be carefully? I already tried simple mailto by html, the code like this:

<form action="mailto:[email protected]" method="post" enctype="text/plain">
<input type="text" name="name"><br>
<input type="text" name="mail"><br>
<input type="text" name="comment" size="50"><br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">

this code is working ok however it only open windows mail and need me retype destination email adddress. I wish after the email address and content is typed, when the send button is clicked. the email can send direcly to detination address.


1 Answer 1


Before I start, a word of caution: Setting this up insecurely not only can, but almost certainly will wind up with your website being used to send a flood of spam until your IP address is banned -- and the way you've phrased your question doesn't suggest you understand the issues enough to avoid this. Whatever you're trying to do, I recommend you find another way.

As to your question...

What you want isn't something a 'static' website can do.

That article you link to and the HTML code you're describing does exactly what it's supposed to -- generate a mailto: event for your browser to handle, which then correctly opens your system's mail client to handle it.

If you want your website to actually send mail, you're going to have to make a dynamic one, using whichever website programming or scripting language you're comfortable with; PHPMailer is a fairly popular choice.

Note that in its default configuration it does no checks whatsoever about the possible legitimacy of the messages it's asked to send, and when while checking my webservers' site logs I routinely find queries from botnets looking for unsecured PHPMailer sites to use to relay their spam. Please be careful.

  • thanks i will try php
    – Norman
    Oct 19, 2020 at 8:08
  • Good advice! :)
    – Seamus
    Oct 19, 2020 at 9:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .