homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Gold Sponsor 2015!
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

Email Autoresponder To ONLY .edu emails?

Msg#: 4460427 posted 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!



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

Msg#: 4460427 posted 7:18 pm on Jun 1, 2012 (gmt 0)

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?


Msg#: 4460427 posted 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.


5+ Year Member

Msg#: 4460427 posted 12:51 am on Jun 3, 2012 (gmt 0)

You'd better worry about:

etc., etc.

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


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

Msg#: 4460427 posted 11:40 am on Jun 3, 2012 (gmt 0)

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.


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

Msg#: 4460427 posted 4:58 pm on Jun 4, 2012 (gmt 0)

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.


Msg#: 4460427 posted 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]


Msg#: 4460427 posted 3:13 pm on Jun 6, 2012 (gmt 0)

Thanks guys, appreciate the suggestions!

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved