繁体   English   中英

如何从输入标签向电子邮件发送附件

[英]how to send an attachment to email from input tag

我想通过html文件输入向电子邮件发送附件。 到目前为止,这是我的代码,我可以发送邮件,但不能发送邮件

    <?php
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$email = $_POST['email'];
$address = $_POST['address'];
$city = $_POST['city'];
$zip = $_POST['zip'];
$country = $_POST['country'];
$position = $_POST['position'];
$services = $_POST['services'];
$filename = $_POST['filename'];
$formcontent=" First Name: $fname \n Last Name: $lname \n Address: $address \n City:$city \n Postal Code:$zip \n Country: $country \n Position Applied for: $position \n email: $email  \n Services Required: $services \n  Resume: $filename";

$recipient = "rohit@gmail.com";
$subject = "Clinogent - Job Application";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");

?>
  <html>
    <head>
        <script>
        function load(){
            window.setTimeout(function() {
                window.location.href="http://www.clinogent.com/currentopeningapply.html";
            },0);
        }
        </script>
    </head>
<body onload="load();">
</body>
 </html>

我如何进一步进行

这是很棒的PHP Mailer类:

https://github.com/PHPMailer/PHPMailer

已经解决了您的问题:

使用phpMailer和PHP从表单发送文件附件

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM