I don’t use wordpress, but from somethings I have read on here by default wordpress uses the php mail function to send emails (some plugins may use a different method) so it should work correctly out of the box … to test this create a php file in your public_html folder and paste the following
<?php
$sender = 'someone@somedomain.tld';
$recipient = 'you@yourdomain.tld';
$subject = "php mail test";
$message = "php test message";
$headers = 'From:' . $sender;
if (mail($recipient, $subject, $message, $headers))
{
echo "Message accepted";
}
else
{
echo "Error: Message not accepted";
}
replacing someone@somedomain.tld and you@yourdomain.tld with something valid that you can access & then navigate to the file through your browser, if it works fine that should be enough for it to work correctly. DON’T FORGET some WP plugins may not use the php mail function so refer to the plugin documentation
If you want to receive emails from contact forms, WordPress notification and such you can just use a SMTP plugin. The setup differs depending on the plugin.
Unless they have postfix listed choose other SMTP and add the values from your virtualmin/usermin email account. It requires values such as SMTP port, Encryption type and soo on.
If you don’t want to use a plugin. You can edit wp config and add the values there as well as some configurations in functions.php. There are several blogs, videos that shows how to set up email without plugin.
Just make sure you have permissions set according to WordPress recommendation in any case.
First thing is to check if your host allow sending emails, some have closed ports for sending emails, so, with or without plugins you can’t send emails. If so, use a third party mailer service like SendLayer or Mailtrap
Plugins are fine in wordpress but don’t rely to heavy on them because will kill your site. Use them until you find a better solution or even make something better. Plugins are a blessing and a curse of wordpress, I used to fix them all the time on freelancer.
If you don’t want to rely on PHP mail() (or wp_mail), you’ll need alongside Postfix also Sendmail on your server.