public static int SendEmail(string mto, string msubject, string mbody, string MyMail, string mailPass)
    {        string from = MyMail;
        string pwd = mailPass;        string to = mto.Trim();
        MailMessage mail = new MailMessage(from, to);
        mail.Subject = msubject;
        mail.SubjectEncoding = System.Text.Encoding.GetEncoding("UTF-8");
        mail.Body = mbody;
        mail.BodyEncoding = System.Text.Encoding.GetEncoding("UTF-8");
        mail.IsBodyHtml = true;
        string server = "";
        int port = 25;
        if (from.IndexOf("@gpres") != -1 || from.IndexOf("@gmail") != -1)
        {
            port = 587;
            server = "smtp.gmail.com";
        }
        else
        {
            port = 25;
            string temp;
            temp = from.Substring(from.LastIndexOf('@') + 1);
            server = "smtp." + temp;
        }
        SmtpClient sc = new SmtpClient(server, port);
        if (port != 25)
        {
            sc.EnableSsl = true;
        }
        sc.Credentials = new NetworkCredential(from, pwd);        try
        {
            sc.Send(mail);
            mail.Dispose();
            return 1;   //发送成功
        }
        catch (Exception ex)
        {
            //System.Web.HttpContext.Current.Response.Write(e.Message); 
            mail.Dispose();
            return 0;  //发送失败
        }
    }知道利用这个方法可以发邮件,谁帮讲个这个方法的原理,最好是那种带有图的,为什么发完,发件箱里是查不到发出的邮件的?