Mailer XP: Use the Send Mail Class, how to send emails.

Hot to send emails using the mailer class.
Mailer XP: Use the Send Mail Class, how to send emails.
Mailer XP: Use the Send Mail Class, how to send emails.

Most Contact pages are already configured, but in case you are building one from scratch first include the Mailer XP class.

require(mxplib_root("mailer.class.php"));

Create the object

$send_mail = new mailer($to_first_name, $to_last_name, $to_email, $from_first_name, $from_last_name, $from_email );

Next you can set up a reply email

$send_mail->set_reply($first_name,$last_name,$email);

Once the object is created you must create the body of the email and choose if either it will plain text or HTML, for plain text use the following method, $body should be plain text:

$send_mail->send_text($subject, $body,$CC=false, $BCC=false);

In this example we will use the HTML version,  $body should be text in HTML, both methods have the same parameters, where $CC, and $BCC are optional, simply leave them empty or add emails separated with commas.

 

$subject = 'emailsubject';
$body = "HTML CONTENT";
$CC = false; //or add emails separated by commas
$BCC = false; //or add emails separated by commas
$twilio = true;
$send_mail->send_html($subject, $body, $CC, $BCC,$twilio);

*If twilio is set to false, emails will be sent using the webiste's server with the mail() function

 

Deprecated: 

send_html($subject, $body, $CC=false, $BCC=false, $twilio = false, $mmusername = null, $mmkey = null, $mmpromo = null, $mmaudiencelist = null, $mmhidden = false, $savemmuser = false)

These variables ($mmusername = null, $mmkey = null, $mmpromo = null, $mmaudiencelist = null, $mmhidden = false, $savemmuser = false) are no longer used.

Comments

Get a Quote

Get a Quote