Closed christianschley closed 5 years ago
The added favicon to the mail is sent as attachment, but not the uploaded file.
What is tofiles()
supposed to do? data('filefield')
returns the item from the $_FILES
array so it might work like this:
'attachments' => [$form->data('filefield')['tmp_name']],
Ah okay, it works this way, but the attached files get the tmp_name as filename and these are e.g.: "phpmWbJ1V" without the extension .jpg or .pdf.
Not very easy to explain this to customers :)
'name' instead of 'tmp_name' doesn't work :/
You could:
move_uploaded_file
to move the file to a temporary location with the updated filename, send it via email and then delete it.addAttachment
here so that you can choose a different file name for the attachment.Please reopen if this is still relevant.
i tried something like
'attachments' => [ 'assets/images/favicon.png', $form->data('filefield'), ],
but it didnt work. There is this error:
So how can i add uploaded files as attachments to the email?