Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

Email Autoresponder To ONLY .edu emails?



4:38 pm on Jun 1, 2012 (gmt 0)

Hi guys,
I'm trying to create an email auto responder that only sends an email if the student enters a specific .edu address. For our college, i'm trying to limit the information in the form to only people from our university.

For example, you go to the form and enter your address. It checks to make sure that the address is "name@university.edu"

If the mail address is a match, the the email autoresponder gets sent out to that person's email address.

Any suggestions as to how to do this? Thanks in advance!


7:18 pm on Jun 1, 2012 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

I'm going to go out on a limb and say you can't do it in html alone. You're looking at php. Not very complicated php, but still. Or, in the alternative, put the whole page in a directory with restricted access that uses a campus e-mail as part of the login.

What if your students send e-mail from their off-campus home computers?


8:01 pm on Jun 1, 2012 (gmt 0)

PHP or javascript would work. Any idea how to go about that?

I have thought about them using other emails, but this is the only way that I can be sure that it is a student at the school.


12:51 am on Jun 3, 2012 (gmt 0)

5+ Year Member

You'd better worry about:

etc., etc.

Editing inputted emails addys ain't for the faint of heart.....


11:40 am on Jun 3, 2012 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

Isn't there a built-in php function that does a lot of address-format screening with a couple of simple commands. (For, er, a given definition of "simple". I don't speak php, so the very sight of all those brackets give me the willies.) Though if you're constraining the address to a specific domain, it may actually be easier to write your own. Set it up negatively: if the address isn't in the exact form "name@example.edu" then put up an irritating little message.

Oh, and I just remembered that schools always give students an e-mail address. They may not choose to use it for everyday mail, but they do have it available. So that's not a worry.


4:58 pm on Jun 4, 2012 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

First, how are you creating this "auto responder?" A PHP example,

if (preg_match('/\.edu$/i',$the_cleansed_email_address)) {
// send the mail here
else { die("Invalid email address"); }

If you're doing this because it's getting spammed and you hope to stop it this way, it won't. Spammers can fake .edu email addresses too.


3:03 pm on Jun 6, 2012 (gmt 0)

If you are only dealing with a single domain, you only need to have the client enter the local-part of their email address, and you provide the '@yourdomain.edu' This way there is no option for anyone to enter another domain name and there is no need to test.

If you are dealing with several domains, you could make a drop-down available for the user to select the appropriate domain from a list.


<p>Enter your email user name</p>
<form method="post" action="yourMailScript.php">
<input type="text" name="name" size="64" />
<select name="domain">
<option value="somedomain.edu">somedomain.edu</option>
<option value="anotherdomain.edu">anotherdomain.edu</option>
<input type="submit" name="submit" value="send" />

This is the simplest solution I can think of. Hope it helps you.

[edited by: Tzakuk at 3:21 pm (utc) on Jun 6, 2012]


3:13 pm on Jun 6, 2012 (gmt 0)

Thanks guys, appreciate the suggestions!

Featured Threads

Hot Threads This Week

Hot Threads This Month