I can programmatically send emails with an attachment with problem. But after searching I can not seem to find the solution of how to attach multiple files. Does any one have the code to this.
Here's the working code I have for sending email.
$mail = variable_get('site_mail', ''); // sets the site wide email address $my_module = 'Email Application'; $my_mail_token = microtime(); $from = $sender; $message = array( 'id' => $my_module, 'to' => $app_email, 'subject' => $subject, 'body' => $body, 'headers' => array( 'From' => $from, 'Sender' => $from, 'Return-Path' => $from, ), ); $message['attachments'] = drupal_realpath($attachment_path); $system = drupal_mail_system($my_module, $my_mail_token);