• λ我爱Aspx >> Asp.Net >> c# 支持SMTP服务器认证的邮件发送类
  • c# 支持SMTP服务器认证的邮件发送类

  • :未知  Դ:internet  :2007-5-20 16:44:04  ؼ:c#
  • /// <summary>

    /// 邮件服务器域名

    /// </summary>

    private string mailserver="";

    /// <summary>

    /// 邮件服务器域名和验证信息

    /// 形如:"user:pass@www.server.com:25",也可省略次要信息。如"user:pass@www.server.com"或"www.server.com"

    /// </summary>

    public string MailDomain

    {

    set

    {

    string maidomain=value.Trim();

    int tempint;

    if(maidomain!="")

    {

    tempint=maidomain.IndexOf("@");

    if(tempint!=-1)

    {

    string up=maidomain.Substring(0,tempint);

    MailServerUserName=up.Substring(0,up.IndexOf(":"));

    MailServerPassWord=up.Substring(up.IndexOf(":")+1,up.Length-up.IndexOf(":")-1);

    string ms=maidomain.Substring(tempint+1,maidomain.Length-tempint-1);

    tempint=ms.IndexOf(":");

    if(tempint!=-1)

    {

    mailserver=ms.Substring(0,tempint);

    mailserverport=System.Convert.ToInt32(ms.Substring(tempint+1,ms.Length-tempint-1));

    Ҷƪл˵?
  • һƪC#编程发送邮件
    һƪ加固Windows Server 2003 IIS 服务器