Ok - let's revise your terminology.
Files are not 'attached' to forms. They are specified in a form using an input element with type = 'file'. The files are then uploaded and made available to your PHP script for handling.
As for them being 'optional', that depends entirely upon your script's processing. If the script logic checks for the existence of the uploaded file and doesn't find it, it can decide whether to proceed without the file or not.
As for your last statement - the form is not coming in via email - it is a POST method that is delivering the data to your script. Perhaps you are talking about the email that your script will be sending, which will not necessarily have a form in it.
If you have a problem with the script not performing as you expect, it is up to you to alter it using some logic.