PAlarm Class Reference

Detailed Description

The PAlarm class is a toolbox to send alarms (text, images) by email.

Definition at line 25 of file PAlarm.h.

#include <PAlarm.h>

Member Function Documentation

◆ SendEmail()

static PResult PAlarm::SendEmail ( const PString smtpURL,
const PString username,
const PString password,
const PString from,
const PString to,
const PString content 

Sends an email.

WARNING: to make it works, curl (binary program, see must be available in the environment, at runtime.

Returns PResult::C_OK if success, another result otherwise.


smtpURL = "smtp://"
username = ""
password = "myPassword"
from = "jane.doe\"
to = "destination\"
content = "From: "John Doe" <john.doe\>
To: "Jane Doe" <jane.doe\@gmailcom>
Subject: This is a test
Hi Jane,
I'm sending this mail with my gmail account.

For Demos, you could use MailGun web service ( which is really simple to use.