I have this code for send a simple notification email.

function mymodule_commerce_checkout_complete($order){
  $buyer = user_load($order->uid);
  if(in_array('wholesale', $buyer->roles)){
    $params['buyer'] = $buyer;
    $params['order'] = $order;
    drupal_mail('commerce_mayoreo_workflow', 'new_order_mayoreo', 'myemail@gmail.com', user_preferred_language($buyer), $params);

This is the hook_mail() implementation.

function mymodule_mail($key, &$message, $params){
  switch ($key) {
    case 'new_order_mayoreo':
      $langcode = $message['language']->language;
      $message['subject'] = t('New Quote request', array('langcode' => $langcode));
      $message['body'][] = t("New Quote request has been created\n\nYou can download the CSV format of the request here:\n\nhttp://bbheperfumes.com/download-order-csv/@order_id",array('@order_id' => $params['order']->order_id), array('langcode' => $langcode));


It's not sending the email, and Im checking in recent log entries and there is not anything about a failed delivery, anything about system tried to send a mail.

I could not figure out why it's not sending the email, so I want to ask if mimemail has something to do with this issue?

I just have the MimeMailSystem in the 2 first select lists that are displayed in the configs of mail system.

By the way, I am using a fresh install of Commerce Kickstart.


Debugging such kind of eMail issues can sometimes be challenging.

Consider the 3 Modules to Help you Debug Emails in Drupal 7. Here is a quote from it:

Problems can exist in multiple areas; like Drupal itself or your mail server. So when an email issue arises you first need to check and see if Drupal is generating emails and then make sure your mail server is sending the emails. Luckily in Drupal there are a few modules that can lessen the pain of debugging emails.

These are the 3 modules/steps mentioned on that link:

PS: Debugging Drupal emails contains another checklist with 8 possible reasons about what may be the problem.

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.