【问题标题】:Drupal 6 Mimemail with attachmentDrupal 6 Mimemail 带附件
【发布时间】:2011-08-07 20:04:34
【问题描述】:

任何人都可以帮助我使用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,'');

【问题讨论】:

    标签: drupal attachment mime-mail


    【解决方案1】:

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

    $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-03-17
      • 1970-01-01
      • 1970-01-01
      • 2012-06-10
      • 1970-01-01
      • 2013-06-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多