Format for sending attachment via email

2 posts by 2 authors in: Forums > CMS Builder
Last Post: August 6, 2019   (RSS)

By nmsinc - July 30, 2019 - edited: July 30, 2019

I have the following email array and I need to add an attachment and I'm not sure how!

if ( @$_REQUEST['save'] ) {
 
  $mailArray1 = array(
                      'to'      => $_REQUEST['email_to'],
                      'from'    => $_REQUEST['email_from'],
                      'subject' => $_REQUEST['subject'],
                      'html'    => $_REQUEST['content']
                      );
                      $mailErrors1   = sendMessage($mailArray1);
                      if ($mailErrors1) {die("Mail Error #1: $mailErrors1"); }
        
      // show thanks
      $errorsAndAlerts   = "Thanks, Your email has been sent along with any attachment!<br/><br/>\n";
     
   $showEmailForm = false;
  
} // end if submit

I also need to know how to code the $PLACEHOLDERS for the attachment during the pass through so that the attachment shows up in the email!:

$FROM        = $PLACEHOLDERS['from'];
$TO        = $SETTINGS['adminEmail'];
$SUBJECT     = $PLACEHOLDERS['subject'];

nmsinc