Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Fake Mail Server

    I am trying to find a way to create a fictitious email server for just fun. It is just for play purposes so it does not need to be fully functional. I just need it to be able to act like you recieve emails (can be an email that I type or automatically generated at a set time) and act like you can send them. This doesn't necessarily have to be Internet-based or web page based. It could be an exe file, but the only programming language I know is JavaScript and even at that I am have not completely mastered it yet. Can anyone help me?

  • #2
    Regular Coder djh101's Avatar
    Join Date
    May 2009
    Location
    California
    Posts
    626
    Thanks
    51
    Thanked 67 Times in 67 Posts
    Well if the email doesn't have to go anywhere, you could just make the email form go away and have a message appear saying that your message was send afterwards.
    Code:
    function mailSend(){
    document.getElementById('mailForm').style.display="none";
    alert("Message sent!");
    }
    "Yeah science!"
    Online Science Tools

  • Users who have thanked djh101 for this post:

    katman (01-17-2012)

  • #3
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thank you, djh101, I appreciate the help. Now is there also a way that I could fake incoming emails?

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,511
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    Can we ask what the purpose is?
    Maybe there's a really good way "thinking outside of the box".

    I'm thinking of something like Picus. An embedded WIFI web server.
    http://www.openpicus.com/

    You basically can browse it, connect to outside physical devices, and
    it can respond back to a browser. Sort of like having your own mini server.
    And it's WIFI, so any PC, laptop, iPad, smart phone can access it.

  • #5
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,812
    Thanks
    42
    Thanked 199 Times in 198 Posts
    if you want to go outside javascript a server is just a place that data gets stored- email servers included- you can create a simple page that has a body portion that you type into and then click "send" and it saves a .txt file on your computer- then you could also have it check to see if files exist ("send/receive" button) where it looks for .txt files in that path and displays them back- there are a lot of ways to emulate- I guess what I am driving @ is similar to mlseim asked- what is the purpose?

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #6
    Regular Coder djh101's Avatar
    Join Date
    May 2009
    Location
    California
    Posts
    626
    Thanks
    51
    Thanked 67 Times in 67 Posts
    Code:
    function mailReceive(){
    	//DISPLAY THE DIV THAT SAYS YOUVE GOT MAIL
    	document.getElementById('receiveMail').style.display = "block";
    	//ADD THE CONTENTS OF YOUR MESSAGE TO THE MESSAGE DIV
    	document.getElementById('message').innerHTML = "Your message here.";
    }
    function mailOpen(){
    	//HIDE THE YOUVE GOT MAILD DIV
    	document.getElementById('receiveMail').style.display = "none";
    	//DISPLAY THE OPEN MESSAGE DIV
    	document.getElementById('viewMail').style.display = "block";
    	return false;
    }
    function mailClose(){
    	//HIDE MESSAGE DIV
    	document.getElementById('viewMail').style.display = "NONE";
    	//SET TIMER TO DISPLAY A NEW MESSAGE AT A RANDOM TIME BETWEEN 2 AND 5 MINUTES
    	setTimeout(mailReceive,( 1000*60*2+Math.floor(Math.random()*1000*60*3) ));
    	return false;
    }
    setTimeout(mailReceive,( 1000*60*2+Math.floor(Math.random()*1000*60*3) ));
    
    ...
    
    <div id="receiveMail" style="display: none;">
    <a href="" onclick="return mailOpen();">You've got mail!</a>
    </div>
    
    <div id="viewMail" style="display: none;">
    <div id="message"></div>
    <a href="" onclick="mailClose();">Delete Message</a>
    </div>
    "Yeah science!"
    Online Science Tools


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •