I was using mimemail(), a function defined from the MIME mail module, in Drupal 6 to send emails using attachments.

The Drupal 7 module doesn't have mimemail().

What function should I use in Drupal 7, instead of mimemail()?


The reason the mimemail() function does not exist for Drupal 7 is because it is not needed.

See, for instance, issue: API function for quick send html mail without uneccessary operations (mimemail analog from 6.x) in the project's issue queue;

On Drupal 7 calling drupal_mail() is enough. See the README.txt and drupal_mail_system() for more information.

The general idea is that you set up the Drupal to use MimeMailSystem for some or all mail messages sent by your module:

  '{$module}_{$key}' => 'MimeMailSystem', // Just messages with $key sent by $module.
  '{$module}' => 'MimeMailSystem', // All messages sent by $module.

and then calling drupal_mail() is enough.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.