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 ".
Simon Greener: "A lot of work went in to designing our application database. PHP Generator allowed us to build a fully functional, professional looking, and functionally powerful web application from that database. It has freed us from worrying about low level code, enabling us to focus on the business requirements of the customer. The support provided is excellent with staff quickly producing answers to questions ranging from newbie to simple or complex. I highly recommend the product".

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