首先需要先自行测试发送文字是否成功,也就是最基本的路是通的,再考虑添加附件。
html:
<form action="/index/index/upload" enctype="multipart/form-data" method="post"> <input type="file" name="jianli" /> <input type="hidden" name="email" value="{$vo.link}"> <button class="btn1">提交简历</button> </form>
ThinkPHP6:
$file = request()->file('jianli'); $email=new Email(); $res=$email->send('xxxx@qq.com','ceshi','ddddd',$_FILES['jianli']['tmp_name'], $_FILES['jianli']['name']); halt($res);
Email.php中把附件打开,$file1,$file2是参数传进来: