. NET uses Openpop to automatically receive messages and store message content in a database

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.