Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
382 views
in Technique[技术] by (71.8m points)

phpmailer - I want to turn off the attachment feature in PHP mail script

I have a php mail script I was wanting it so when it automatically sends the auto responder I have the ability to attach multiple files so the person submitting the form gets an automatic reply with the file attachments for eg a member signup pdf etc.

I want the ability to be able to turn off the attachment feature in the autoresponder if I dont want a file to be set out.

   // preparing attachments

    foreach($_FILES as $userfile){

        if($userfile['tmp_name'] != '')

        {

            $message .= "--{$mime_boundary}
";

            $data = chunk_split(base64_encode(file_get_contents($userfile['tmp_name'])));

            $message .= "Content-Type: application/octet-stream; name="".basename($userfile['name']).""
" . 

            "Content-Description: ".basename($userfile['name'])."
" .

            "Content-Disposition: attachment;
" . " filename="".basename($userfile['name']).""; size=".filesize($userfile['tmp_name']).";
" . 

            "Content-Transfer-Encoding: base64

" . $data . "

";

        }

    }
question from:https://stackoverflow.com/questions/65557669/i-want-to-turn-off-the-attachment-feature-in-php-mail-script

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...