首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何通过curl在Codeigniter中使用Mailgun中的附件

如何通过curl在Codeigniter中使用Mailgun中的附件
EN

Stack Overflow用户
提问于 2018-12-18 04:56:37
回答 1查看 507关注 0票数 0

我是StackOverflow的新手,因为我不会发布任何东西。如果我没有做好这件事,请原谅。

我找到了一篇文章,展示了如何在Codeigniter中集成Mailgun,它工作得很好。请查看此处- How to work with Mailgun API in CodeIgniter; Forbidden error in curl_exe()

当我想在同一段代码中附加一个pdf时,我的问题就来了。不是使用

$this->mailgun::send([
  'from' => "Example.com team <no-reply@mg.example.com>",
  'to' => "somerandomuser@gmail.com",
  'subject' => "Welcome to Example.com",
  'text' => "We just want to say hi. Have fun at Example.com"
]);

我曾希望用到以下几点:

$this->mailgun->send([
            'from' => "Web Admin <postmaster@xxxxxx.xxxxxs.org>",
            'to' => $toemail,
            'subject' => $subj,
            'text' => $bodtxt,
            'html' => $bod,
            'attachment' => curl_file_create($increport , 'application/pdf', $increportnm),
            'h:Reply-To' => $replyname . ' <' . $replyemail . '>'
        ]);

其中$increport是我的pdf文件的路径,$increportnm是pdf文件的名称。

当我运行此命令时,没有任何电子邮件发布到Mailgun :(

有人能帮我吗?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53822881

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档