Categories
Powershell

Powershell : Module – Emailer

Introduction

A small emailer module which can be used to send emails using a locally available SMTP server.

Input

None

Output

An email is generated where a local SMTP server is available to route the email request

Logging

None

Usage Examples

Import the module to your script and then call it as per the example in the script

Dependancies

None

The Script

# Name      : Powershell Emailer when local SMPT available
# Author    : Dave 
# Date      : 
# Ticket#   : NONE
# Scope     : Power Shell Module, to the called by scripts
# Input(s)  : $emailFrom > [STR] > the sender's email address,
#             $emailTo   > [STR] > the target email addres,
#             $subject   > [STR] > the subject of the email 
#             $body  > [STR] > the email body
# Output(s) : An email is sent to the address specified.
#
# Example call:
# emailer "to@something.com" "from@somewhere.com" "email subject" "email body"
####################################################
 
# Notes:
########################
 
Function emailer ($emailTo, $emailFrom, $emailSubject, $emailBody)
<# This is a simple function that that sends an smtp email using the variables to define the email
i.e. "Function emailer ($emailFrom, $emailTo, $subject, $body) "
 
#>
 
{
$emailSmtpServer = "smtp.SOME.AVAILABLE.DOMAIN.COM"
Send-MailMessage -To $emailTo -From $emailFrom -Subject $emailSubject -Body $emailBody -SmtpServer $emailSmtpServer
}
Categories
Linux

Ubuntu & Virtualbox

Ubuntu 16.04 (kernel 4.14), Virtualbox

I was trying to install Oracle VirtualBox either from their repo or from the Ubuntu repo but both failed to compile the Kernel Module.

I tried various guides before actually reading the error log whereupon I found the “libelf-dev” package was required (at least for installing virtualbox-5.2 from Oracle directly!).