1. Download the Openpop and add the Openpop to the solution.
2.
1 Else if(E.commandname = ="connecttest")2 {3 stringSserver_url =NewDynamicControl ( This,"Server_url"). Text;4 stringSPORT =NewDynamicControl ( This,"PORT"). Text;5 stringSemail_user =NewDynamicControl ( This,"Email_user"). Text;6Guid Ginbound_email_key = Sql.toguid (application["CONFIG. Inboundemailkey"]);7Guid Ginbound_email_iv = Sql.toguid (application["CONFIG. Inboundemailiv"]);8 stringSemail_password = sql.tostring (viewstate["Smtppass"]);9 if(!sql.isemptystring (Semail_password))TenSemail_password =Security.decryptpassword (Semail_password, Ginbound_email_key, Ginbound_email_iv); One Receiveemailbyopenpop (Semail_user, Semail_password); A } - Else if(E.commandname = =the ReceiveTest") - { theGuid Ginbound_email_key = Sql.toguid (application["CONFIG. Inboundemailkey"]); -Guid Ginbound_email_iv = Sql.toguid (application["CONFIG. Inboundemailiv"]); - stringSemail_password = sql.tostring (viewstate["Smtppass"]); - if(!sql.isemptystring (Semail_password)) +Semail_password =Security.decryptpassword (Semail_password, Ginbound_email_key, Ginbound_email_iv); - + stringSservice =NewDynamicControl ( This,"SERVICE"). SelectedValue; A stringSserver_url =NewDynamicControl ( This,"Server_url"). Text; at intNport =NewDynamicControl ( This,"PORT"). IntegerValue; - BOOLBmailbox_ssl =NewDynamicControl ( This,"Mailbox_ssl"). Checked; - stringSemail_user =NewDynamicControl ( This,"Email_user"). Text; - stringSmailbox =NewDynamicControl ( This,"MAILBOX"). Text; -StringBuilder sberrors =NewStringBuilder (); - if(String.Compare (Sservice,"POP3",true) ==0) in { - poputils.validate (Context, Sserver_url, Nport, Bmailbox_ssl, Semail_user, Semail_password, SbE rrors); toCtldynamicbuttons.errortext =sberrors.tostring (); + } - Else if(String.Compare (Sservice,"IMAP",true) ==0) the { * imaputils.validate (Context, Sserver_url, Nport, Bmailbox_ssl, Semail_user, Semail_password, SM Ailbox, sberrors); $Ctldynamicbuttons.errortext =sberrors.tostring ();Panax Notoginseng } - Else the { + Throw(NewException ("unknown/unsupported Mail Service:"+sservice)); A } the}
. NET uses Openpop to automatically receive messages and store message content in a database