Setting up a secure mailing list

Hello All

I would like to develop a secure way to collect email addresses via my website and build a mailing list. What I use to do was have a simple form on my website that the user would use to enter their email address. Once they hit submit, I would use the mail() function in php to send myself an email with their email address. I would then put that email address in a txt file to use later when I needed to send out emails. Hackers/bots were able to use my script to install a spam bot on my server.

What would be a more secure and automated way of collecting email addresses and setting up a mailing list?

 

 

 

 

Top