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

Subscribe to our news:
Partners
Testimonials
Craig Cordell: "The simplicity of your code generator is fantastic. We've evaluated dozens of others over the past few years but have yet to find one that is as easy to use as yours".
Lucian Nedescu: "Thank you very much. Have a nice century (this is a real wish :P). I think that i will do a great job on my clients database with the new php interface. Thank You again".

More

Add your opinion

PHP Generator for MySQL 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