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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…