0

任何人都可以帮助我使用drupal mimemail作为附件我正在使用下面提到的代码在特定电子邮件上发送附件文件,但不知何故它不起作用,请帮助我提前感谢

    $body = "test body with attachments";
    $subject = "My test message";

$attachments[]=array(
    'filepath' => file_directory_path().'/document.pdf',
    'filename' => 'wonderful.pdf',
    'filemime' => 'application/pdf',
);

mimemail("xxxxx@gmail.com", "xxxxxx2@gmail.com", $subject, $body, NULL, array(), NULL, $attachments,'');
4

1 回答 1

0

我正在做一些非常相似的事情。我的代码基本上是:

$message['attachments'][] = array(
  'filepath' => $zipfilepath,
  'filename' => 'my-attachment.zip',
  'filemime' => 'application/zip',
);

从我的 hook_mail 模块回调中。见http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hook_mail/6

您确定您已执行以下操作:

  • 启用“mimemail”模块;
  • 在管理员中选中“对所有消息使用 mime 邮件”选项;
  • 选择“mimemail”作为“电子邮件引擎”(在管理页面的底部)。

我的工作正常。我也安装了 SMTP 模块,它可以与被选为电子邮件引擎的任一模块一起使用。

于 2011-05-17T01:55:34.993 回答