Code Snippets

  

ActionScript Source Code


Welcome to Dream.In.Code
Getting Help is Easy!

Join 131,943 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,893 people online right now. Registration is fast and FREE... Join Now!





Pop3 Socket Connection AS3

This code will open a socket and allow you to access anything on your email server. This snippet is based off the tutorial on gotoandlearn.com with a few changes, but if you are having trouble implementing it I would highly recommend you watch the full tutorial.

Submitted By: Kerplope
Actions:
Rating:
Views: 95

Language: ActionScript

Last Modified: October 8, 2008
Instructions: You will need to edit the data to match you email password and incoming mail server.

Snippet


  1. //defines a connection between the mail server and your computer
  2. var yourSocket:Socket = new Socket("incoming_mail_server", 110);
  3. yoursocket.addEventListener(ProgressEvent.SOCKET_DATA,openSocketConnection);
  4. function openSocketConnection(evt:ProgressEvent):void {
  5. //Writes your email and password in a unicode format that the pop3 server can read .
  6.         s.writeUTFBytes("emailaddress\n");
  7.         s.writeUTFBytes("password\n");
  8.         s.writeUTFBytes("STAT\n");
  9. //Sends the data written in UTFBytes through the socket connection
  10.         s.flush();
  11. //At this point you should consult a pop3 reference guide to preform functions on the server.
  12. }

Copy & Paste


Comments


There are currently no comments for this snippet. Be the first to comment!

Add comment


You must be registered and logged on to </dream.in.code> to leave comments.





Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month