1 #ifdef WIN32 2 #include <windows.h> 3 #include <stdio.h> 4 #else 5 6 #include <stdio.h> 7 #include <sys/types.h> 8 #include <sys/socket.h> 9 #include <netinet/in.h> 10 #include <errno.h> 11 #include <unistd.h> 12 #include <sys/time.h> 13 #endif 14 struct data6 15 { 16 unsigned int d4:6; 17 unsigned int d3:6; 18 unsigned int d2:6; 19 unsigned int d1:6; 20 }; 21 // 协议中加密部分使用的是base64方法 22 char con628(char c6); 23 void base64(char *dbuf,char *buf128,int len); 24 void sendemail(char *email,char *body); 25 int open_socket(struct sockaddr *addr); 26 27 int main() 28 { 29 char email[] = "987654321@qq.com"; 30 char body[] = "From: "lucy"<123456789@qq.com> " 31 "To: "dasiy"<987654321@qq.com> " 32 "Subject: Hello " 33 "Hello World, Hello Email!"; 34 sendemail(email, body); 35 return 0; 36 } 37 38 char con628(char c6) 39 { 40 char rtn = '