最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
记得原来有人问过用socket实现smtp,这是我的一部分代码
时间:2022-07-02 12:05:05 编辑:袖梨 来源:一聚教程网
                                            namespace mySmtp 
{
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Collections;
interface ITransport
{
void setHost(String smtpHost);
String getHost();
    
void setPort(int smtpPort);
int getPort();
    
void sendMail(MailMessage msg);
}
public class Smtp : ITransport
{
private String smtpHost;
private int smtpPort;
        
public Smtp()
{
//smtpHost = "127.0.0.1";
//smtpPort = 25;
}
        
public Smtp(String host, int port)
{
smtpHost = host;
smtpPort = port;
                                        				                
                    
                        
                            
                        
                
                
            {
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Collections;
interface ITransport
{
void setHost(String smtpHost);
String getHost();
void setPort(int smtpPort);
int getPort();
void sendMail(MailMessage msg);
}
public class Smtp : ITransport
{
private String smtpHost;
private int smtpPort;
public Smtp()
{
//smtpHost = "127.0.0.1";
//smtpPort = 25;
}
public Smtp(String host, int port)
{
smtpHost = host;
smtpPort = port;
相关文章
- 伊莫花舞兰怎么样 花舞兰角色介绍 10-31
- 星塔旅人强化机在哪 强化机位置一览 10-31
- 星塔旅人等级怎么突破 等级突破方法 10-31
- 辉烬知世怎么配队 知世配队攻略 10-31
- 口袋斗罗大陆独孤博技能是什么 独孤博技能介绍一览 10-31
- 王者万象棋香香怎么玩 香香玩法介绍 10-31
 
             
                                 
                                 
                                 
                                 
                                            
                                         
                                            
                                         
                                            
                                         
                                            
                                         
                                            
                                         
                                            
                                         
                                            
                                         
                                            
                                         
                                            
                                        