Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

in my site when user submit a dination i want to send email to donor,charity and delivery service at same time(three different emails) in code and i want to kown how can i achieve that,below is the my mail seding function,i already tried call email function with 3 times with different keys for $key but that time emails are sending with out body content

 function zgRequestsdonor2_mail ($key, &$message, $params) {
  switch ($key) {
  case 'aftersubmit_donor':
    // Set headers etc

    $message['subject'] = t('email to donor');
    //$message['body'][] = t('Hello @username,', array('@username' => $params['username']));
    $message['body'][] = 'tyrtyrtyrtyty';
    break;
  }
}

calling it at

function zgRequestsdonor2_form_submit($form, &$form_state) {
  drupal_mail('zgRequestsdonor2','aftersubmit_donor',$donoremail, $language, $params = array(), $from = NULL, $send = TRUE);
}
share|improve this question
add comment (requires an account with 50 reputation)

1 Answer

If you want to send same mail to donor, charity and delivery service, then you can use CC feature of the mail.

$message['headers']['CC'] = "[email protected]";
share|improve this answer
no i want to send three diffrent emails to them..,i tried call the mail function three times but then emails are send with out body content... – las77 Apr 23 at 7:16
add comment (requires an account with 50 reputation)

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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