Пример #1
0
  }//public String UserState

  /// <summary>ButtonSubmit_Click().</summary>
  public void ButtonSubmit_Click
  (
   Object sender, 
   EventArgs e
  )
  {

   int       smtpPort          =  -1;
   String    exceptionMessage  =  null;

   String    smtpServer        =  null;
   String    from              =  null;
   String    to                =  null;
   String    cc                =  null;
   String    bcc               =  null;
   String    subject           =  null;
   String    body              =  null;
   String[]  attachment        =  null;
   String    userState         =  null;

   UtilityMailArgument           utilityMailArgument               =  null;
   
   smtpPort                  =  SmtpPort;
   smtpServer                =  SmtpServer;
   from                      =  From;
   to                        =  To;
   cc                        =  Cc;
   bcc                       =  Bcc;
   subject                   =  Subject;
   body                      =  Body;
   attachment                =  new String[] { Attachment };
   userState                 =  UserState;

   utilityMailArgument = new UtilityMailArgument
   (
    smtpPort,
    smtpServer,
    from,
    to,
    cc,
    bcc,
    subject,
    body,
    attachment,
    userState
   );

   UtilityMail.MailSend
   (
    ref utilityMailArgument,
    ref exceptionMessage
   );

   Feedback = exceptionMessage;

  }//public void ButtonSubmit_Click()
Пример #2
0
  /// <summary>Page Load.</summary>
  public void Page_Load
  (
   object     sender, 
   EventArgs  e
  ) 
  {

   String  exceptionMessage  =  null;

   ServerMapPath = this.MapPath("");

   /* 
   FilenameConfigurationXml = Server.MapPath( FilenameConfigurationXml );
   */

   if ( ServerMapPath != null)
   {
    FilenameConfigurationXml = ServerMapPath + @"\" + FilenameConfigurationXml;
   }//if ( ServerMapPath != null)

   UtilityMail.ConfigurationXml
   (
        FilenameConfigurationXml,
    ref exceptionMessage,
    ref DatabaseConnectionString,
    ref DefaultSmtpPort,
    ref DefaultSmtpServer
   );

   if ( exceptionMessage != null )
   {
    Feedback = exceptionMessage;
    return;
   }//if ( exceptionMessage != null )

   SmtpPort    =  DefaultSmtpPort;
   SmtpServer  =  DefaultSmtpServer;

  }//Page_Load