I'm using drupal_mail for sending eMails from a custom module. This is the code:
function changeme_node_update($node) {
...
$to = "[email protected]";
$from = "[email protected]";
$subject = 'sampletext ' . $nodedate;
$body = "Dear " . $user_name . "! \r\nSome more text\r\n\r\n" . $nodetitle . "\r\nDate:" . $nodedate . "\r\nTime:" . $nodetime . " h";
$body .= "\r\n\r\nSome more text here";
//call mail function
$params = array(
'subject' => $subject,
'body' => $body,
);
drupal_mail('changeme', 'information', $to, "de", $params, $from);
...
}
function changeme_mail($key, &$message, $params) {
switch ($key) {
case 'information':
$message['subject'] = $params['subject'];
$message['body'] = $params['body'];
break;
}
}
I'm receiving emails with the subject but the message is missing. Also, where to change the encoding?
Thanks!