使用php将文件附加到电子邮件 [英] attach file to email using php
本文介绍了使用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>
解决方案
看看
- 对于(文件),href =http://docs.php.net/features.file-upload =nofollow noreferrer> http://docs.php.net/features.file-upload )上传部分脚本
- http://swiftmailer.org / docs / message-attachments 发送带附件的电子邮件
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
- http://docs.php.net/features.file-upload for the (file) upload part of the script
- http://swiftmailer.org/docs/message-attachments for sending emails with attachments
这篇关于使用php将文件附加到电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文