Welcome Guest! To enable all features please Login or Register.



Go to last post Go to first unread
#1 Posted : Thursday, June 2, 2011 5:18:39 PM(UTC)

Rank: Administration

Groups: Administrators
Joined: 11/11/2010(UTC)
Posts: 1,088

Thanks: 9 times
Was thanked: 46 time(s) in 46 post(s)
JavaScript Example

The following code demonstrates how to receive email from a POP3 mail account. This sample downloads emails from POP3 server and deletes the email after the email is retrieved.


MailServerPop3 = 0;
MailServerImap4 = 1;

    var oServer = new ActiveXObject("EAGetMailObj.MailServer");
    // please change the server, user, password to yours
    oServer.Server = "pop3.adminsystem.com"
    oServer.Protocol = MailServerPop3;

    oServer.User = "testx";
    oServer.Password = "testpassword";

    // If your server requires SSL connection, 
    // Please add the following codes.
    oServer.SSLConnection = true;
    oServer.Port = 995;

    var oClient = new ActiveXObject("EAGetMailObj.MailClient");
    oClient.LicenseCode = "TryIt";
    // Connect POP3 server.

    var infos = new VBArray(oClient.GetMailInfos()).toArray();
    for (var i = 0; i < infos.length; i++) {
        var info = infos[i];

        // Receive email from POP3 server
        var oMail = oClient.GetMail(info);

        // Save email to local disk
        oMail.SaveAs("d:\\" + i + "_test.eml", true);

        // Mark email as deleted on server.

    // Quit and pure emails marked as deleted from POP3 server.
catch( err )
      WScript.Echo( err.description );

Edited by user Thursday, June 2, 2011 5:30:36 PM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2021, Yet Another Forum.NET
This page was generated in 0.159 seconds.


© All Rights Reserved, AdminSystem Software Limited.