#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2010
    Posts
    33
    Rep Power
    9

    Question Secure JS + PHP script to send email with attachment?


    Hello,

    I only have average coding skills, and need to write a web form to let users 1) fill a few fields, 2) attach a text file, and 3) send everything to a PHP-enabled shared server that will take care of building the email and sending the whole thing to a mailbox.

    I'd like to find some secure JavaScript > Ajax > PHP code to reduce the risk of SPAM/viruses to the minimum.

    I found this, but it performs no check on the client-side:
    https://www.geeksforgeeks.org/php-se...achment-email/

    Also, someone does not "recommend using a php script to send mail with attachments (rather supply a downloadlink and store the document on the server for retrieval for the mail target)".

    Would someone have code handy I could use?

    Thank you.
  2. #2
  3. Lord of the Dance
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Oct 2003
    Posts
    4,196
    Rep Power
    2012
    Someone suggested you to use PHPmailer, did you have a look at that?

    There should be several tutorials on the net about form validation, I suggest you also look at some of those.

    If you have a form and want to "prevent" (read: limit) the bots, you have to look into captcha like solutions.

    There is a "Hire A Programmer" forum if you just want the solution.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2010
    Posts
    33
    Rep Power
    9
    I understand. Thank you.

IMN logo majestic logo threadwatch logo seochat tools logo