using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Net;
using System.Net.Mail;

public partial class Koniec : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {        
        //komunikat
        if (Session["komunikat"] != null) Label1.Text = (string)Session["komunikat"];            
        else Response.Redirect("Formularz.aspx");

        /*
        //odczytanie adresu e-mail
        if (Session["komunikat"] == null) Response.Redirect("Formularz.aspx");
        StrukturyDanych.Osoba osoba = (StrukturyDanych.Osoba)Session["osoba"];
        string email = osoba.Email;

        //wysylanie listu
        if (Session["listWyslany"] == null)
        {
            Session.Add("listWyslany", true);
            string serwerSMTP = "smtp.fizyka.umk.pl";
            //string serwerSMTP = "smtp.psk.pl"; //serwer SMTP
            int portSMTP = 25;
            SmtpClient smtp = new SmtpClient(serwerSMTP, portSMTP);
            smtp.Credentials = CredentialCache.DefaultNetworkCredentials;
            MailMessage list = new MailMessage("konferencja@psk.pl", email);
            list.Subject = "Potwierdzenie zgłoszenia na III Krajową Konferencję klimatologów";
            list.IsBodyHtml = true;
            list.Body = Label1.Text;
            smtp.Send(list);
        }
        */
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("Default.aspx");
    }
}
