带附件的 Drupal 6 Mimemail

发布于 2024-11-02 05:09:16 字数 699 浏览 6 评论 0原文

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

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

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

mimemail("[email protected]", "[email protected]", $subject, $body, NULL, array(), NULL, $attachments,'');

Can anyone help me with drupal mimemail for attachment i am using below mentioned code to send attachment file on specific email, but somehow its not working, kinldy help me thanks in advance

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

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

mimemail("[email protected]", "[email protected]", $subject, $body, NULL, array(), NULL, $attachments,'');

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

2024-11-09 05:09:16

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

$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 模块,并且它可以与选择作为电子邮件引擎的任一模块一起使用。

I'm doing something very similar. My code is basically:

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

from within my hook_mail module callback. See http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hook_mail/6

Are you sure that you've done the following:

  • enabled "mimemail" module;
  • checked the option in admin to "Use mime mail for all messages";
  • selected "mimemail" as the "E-mail Engine" (at the bottom of the admin page).

Mine is working just fine. I have SMTP module installed as well, and it works with either module selected as the Email Engine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文