使用phpMailer和PHP从表单发送文件附件
example.com/contact-us.php
<form method="post" action="process.php" enctype="multipart/form-data"> <input type="file" name="uploaded_file" id="uploaded_file" /> <input type="hidden" name="MAX_FILE_SIZE" value="10000000" /></form>
process.php
PHPMailer()
require("phpmailer.php");$mail = new PHPMailer(); $mail->From = me@example.com;$mail->FromName = My name;$mail->AddAddress(me@example.com,"John Doe"); $mail->WordWrap = 50;$mail->IsHTML(true);$mail->Subject = "Contact Form Submitted"; $mail->Body = "This is the body of the message.";
uploaded_file
.
我的问题
uploaded_file
process.php
AddAttachment();
Body
process.php
uploaded_file
$_FILES['uploaded_file']
AddAttachment();
米脂
牛魔王的故事
慕森卡