1

I have this code in a custom module used to send an email through Mimemail

  if (!isset($message['headers'])) $message['headers'] = array('From' => $from, 'Sender' => variable_get('site_name', 'Drupal'), 'Return-Path' => variable_get('site_mail', ini_get('sendmail_from'))); 
  if (!isset($message['key'])) $message['key'] = array();
    $message = mimemail_prepare_message($message);
    $result = mimemail_mailengine('send', $message);
    if ($result) {
      drupal_set_message(t('Mailing sent sucessfully'));      
    }
    else {
      drupal_set_message(t('Mailing not sent'), 'error');
    }
}

It works fine on my local MAMP enviorment, and on my Dreamhost VPS, but when I try to run on Media Temple a dedicated virtual box running Ubuntu, it does not work. I get my error message "Mailing not sent"

drupal_mail_system works fine

3
  • 1
    SSH in to your server and run which sendmail just to make sure sendmail is installed, and to verify it's location (I think it's /usr/sbin/sendmail by default). Then have a look at your php.ini file, and search for sendmail_path. If it's commented out, uncomment it and set it to the path you found with the which statement. Then restart Apache and see if you still get errors – Clive Apr 30 '12 at 17:26
  • Sendmail was not installed, I installed it and am now able to send emails through the command line. Sending email through my module still does not work though. – albo Apr 30 '12 at 18:10
  • Did you check your php.ini configurations. This article might be useful. – Ajay Kotian Apr 30 '12 at 21:07

Your Answer

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

Browse other questions tagged or ask your own question.