Hello all,

This is a question about a PHP script for collecting e-mails in my submission box at my website that I'd like help in writing myself in order to do the following:

1. Check the submission to see if it is, in fact, at a web address with an @ in the submission.
If it contains an e-mail address, send a test e-mail and see if the e-mail address is valid.
If it sends successfully, do the following:
Display screen with "Check here if you would like to be added to..."
When that is selected and the user clicks okay, do this:
Send an e-mail to 2 e-mail addresses for me
Write user to mySQL database on server.

To start, this is what is there for the form on the home page:
<form id="emailbox" name="form1" method="post" action="email.php">
          <input type="text" name="go" id="go" value="your e-mail" onclick="input_focus(this)"  onblur="input_reset(this)"/>
          <input type="submit" value="Join" />

I was having trouble finding a good predefined method in the php.net directories for strings to test if there is a .com, .net, .biz, .org, .info, etc. & if there is an @ in the submission- do you know of one?

I would also like to limit the number of characters in a valid submission. Let me liberal, say, a maximum of 60 characters. Would that be done in JavaScript or something besides PHP?

I would be using a global variable, $email, which would be initialized through
, as you can see in the form markup. Then I can make a function, isItAValidEmail(), for the submission testing, then a second function for test e-mail and e-mail list joining acceptance is displayed using the echo(**some HTML & their styles**) function.

Thanks for the suggestions.
I'd like to do this on my own and build some experience with PHP instead of just use some service.