PHP中的电子邮件附件? [英] Email attachment in PHP?

查看:110
本文介绍了PHP中的电子邮件附件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面,其中包含文件" html输入字段和一个提交"按钮,如下所示:

I have a page with "File" html input field and a "Submit" button as below:

<form id="formUploadfile" name="formUploadfile" method="post" action="" class="form" enctype="multipart/form-data">
        <label for="name"><strong>File</strong></label>
        <input type="file" name="uploaded_file" size="35" />
        <button type="submit" class="btn_common" id="inquiry_submit" name="inquiry_submit">
            Submit
        </button>
    </form>

我想将所选文件发送到预定义的电子邮件地址.在PHP中,在将其作为附件电子邮件发送之前,是否需要先将文件上传到服务器?或者无需将其上传到服务器,也可以使用.

I want to send the selected file to a pre-defined email address. In PHP, Do I need to upload the file to my server first before sending it as an attachment email? Or without uploading it to server, it will work.

我搜索了Google,但未找到上述问题的答案,请提供帮助.如果有人有用于相同目的的代码,请提供链接.

I Googled but didn't find the answer of above question, please help. If anyone have a code for the same purpose, please provide link.

谢谢

推荐答案

是的,您需要先将文件上传到服务器.

Yes, you will need to upload the file to the server first.

使用类似 Swiftmailer 的邮件类发送文件.

Use a mailing class like Swiftmailer to send the file.

这篇关于PHP中的电子邮件附件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆