Questions tagged «email-attachments»

8
使用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。 …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.