Self hosting solution (cheap and configurable, but you take up the risks and responsibilities of securing it):
Create a single index.php file and host it on a PHP server
<?php
if(isset($_POST['submit'])){
$to = $_POST['email'];
$from = "mailer@yourcompany.com";
$name = $_POST['name'];
$subject = "Sample Subject";
$message = $name . " " . " wrote the following:" . "\n\n" . $_POST['message'];
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
// If you want to have a success page, uncomment the next line
// header('Location: thank_you.php');
// to redirect to another page.
// you need to create another file named thank_you.php
}
?>
<!DOCTYPE html>
<head>
<title>Form submission</title>
</head>
<body>
<form action="" method="post">
Name: <input type="text" name="name"><br>
Email: <input type="text" name="email"><br>
Message:<br><textarea rows="5" name="message" cols="30"></textarea><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
EDIT: For authentication, you can do something simple using HTTP auth (It's not super secure or anything, but it just does the job)
<?php
$AUTH_USER = 'admin';
$AUTH_PASS = 'admin';
header('Cache-Control: no-cache, must-revalidate, max-age=0');
$has_supplied_credentials = !(empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['PHP_AUTH_PW']));
$is_not_authenticated = (
!$has_supplied_credentials ||
$_SERVER['PHP_AUTH_USER'] != $AUTH_USER ||
$_SERVER['PHP_AUTH_PW'] != $AUTH_PASS
);
if ($is_not_authenticated) {
header('HTTP/1.1 401 Authorization Required');
header('WWW-Authenticate: Basic realm="Access denied"');
exit;
} else {
// all that code from above goes here...
}
?>