Article 5RP3N Set up email sender on a cloud server

Set up email sender on a cloud server

by
Pedroski
from LinuxQuestions.org on (#5RP3N)
I am very new to setting up a cloud server.

On my shared hosting webpages, I suppose email is set up already, my contact page sends me a message, no problem.

I have set up the contact page on the cloud server, it opens as it should.

What do I need to enable PHP to send an email on this Ubuntu 20.04 Server?

What do I need to install?

On the shared hosting, this little bit of PHP works fine.

Code:<?php

$q1 = $_POST['name'];
$q2 = $_POST['email'];
$q3 = $_POST['message'];

$body = "
".$q1."
".$q2."
".$q3."
";

$to1 = "me@mymail.com";
$subject = $q1 . " message";
$headers = "From: peter@mywebpage.com\r\n";
$headers .= 'Content-Type: text/plain; charset=utf-8';
mail($to1, $subject, $body, $headers);
?>latest?d=yIl2AUoC8zA latest?i=lrML8tARSbM:959RmflSo9U:F7zBnMy latest?i=lrML8tARSbM:959RmflSo9U:V_sGLiP latest?d=qj6IDK7rITs latest?i=lrML8tARSbM:959RmflSo9U:gIN9vFwlrML8tARSbM
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments