Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
John Gondek: "Your software is amazing. I consider myself a novice at PHP and JS and with your software I have a web page that is truly fantastic. Thank you so much ".
Olivier Auverlot: "At my work (a universitary computer research laboratory), I'm alone to create all applications and databases. I don't know how I could do all the work without it. It's really a very productive software. I can focus on the database schemas and create quickly the user applications with a minimal amount of code to maintain".

More

Add your opinion

PostgreSQL PHP Generator online Help

Prev Return to chapter overview Next

sendMailMessage

Sends an email message to specified recipients using project-level outgoing mail settings.

 

Signature:

function sendMailMessage($recipients, $messageSubject, $messageBody, 

       $attachments = '', $cc = '', $bcc = '')

 

Parameters:

Name

Data type

Description

Mandatory

$recipients

string or array

A recipient or a list of recipients for the email message

yes

$messageSubject

string

A subject of the email message

yes

$messageBody

string

A body of the email message. HTML is allowed.

yes

$attachments

string or array

An attachment or a list of attachments for the email message

no

$cc

string or array

A recipient or a list of recipients specified in the CC field

no

$bcc

string or array

A recipient or a list of recipients specified in the BCC field

no

 

Example 1

This example demonstrates the simplest use of the function.

 

sendMailMessage('recipient@example.com', 'Message subject', 'Message body');

 

Example 2

This example demonstrates an advanced use of the function.

 

$messageSubject = 'Welcome!!!';

$messageBody = file_get_contents("external_data/mail_message_body.html");

    

$attachments = 

    array(

        'external_data/files/example.pdf',

        'external_data/images/example.png'

    );

$cc = array('mark_lynch@example.com', 'david_frost@example.gov'); 

$bcc = 

    array(

        'dougie_jones@example.edu' => 'Dougie Jones',

        'bob_cooper@example.com' => 'Bob Cooper',        

        'laura_horne@example.en' => 'Laura Horne'        

    );

        

sendMailMessage('admin@example.com', $messageSubject, $messageBody, $attachments, $cc, $bcc);

 

See also: Setting up common SMTP servers.



Prev Return to chapter overview Next