使用php将文件附加到电子邮件 [英] attach file to email using php

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

问题描述

我的表单上有一个输入,允许用户浏览到文件位置。这个想法是他们可以将简历附加到他们准备提交的应用程序中。

 < label class = descriptionfor =element_5>上传文件< / label> 
< div>
< input id =element_5name =element_5class =element filetype =file/>

对于我的文字feilds和下拉菜单,我一直在使用沿着

  $ experince = $ _POST [experince]; 

但我不希望路径字符串我想要acutall文件。如何获取文件本身,如何将其附加到电子邮件



奖金有一个简单的方法来限制附件到.doc / .pdf? p>

解决方案

看看




I have an input on my form to allow a user to browse to a file location. the idea being that they can attach a resume to to the application they are getting ready to submit.

<label class="description" for="element_5">Upload a File </label>
        <div>
            <input id="element_5" name="element_5" class="element file" type="file"/> 

For my text feilds and dropdowns i have been using something along the lines of

$experince = $_POST["experince"];

but I don't want the path string i want the acutall file. how do I get the file itself and how do I attach it to the email

bonus is there a easy way to limit the attachment to .doc / .pdf?

解决方案

Take a look at

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

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