Simple PHP form: Attachment to email (code golf)

后端 未结 6 1366
半阙折子戏
半阙折子戏 2020-11-29 17:38

Imagine a user that would like to put a form on their website that would allow a website visitor to upload a file and a simple message, which will immediately be emailed (ie

6条回答
  •  天涯浪人
    2020-11-29 18:26

    This article "How to create PHP based email form with file attachment" presents step-by-step instructions how to achieve your requirement.

    Quote:

    This article shows you how to create a PHP based email form that supports file attachment. The article will also show you how to validate the type and size of the uploaded file.

    It consists of the following steps:

    • The HTML form with file upload box
    • Getting the uploaded file in the PHP script
    • Validating the size and extension of the uploaded file
    • Copy the uploaded file
    • Sending the Email

    The entire example code can be downloaded here

提交回复
热议问题