📄 mymail.cpp
字号:
//mymail.cpp#include <iostream>#include <cstring>#include "MySmtp.h"#define _DEBUGusing namespace std;int main(){ string Mailto; string Subject; string Body; string buf; string filepath; MySmtp mymail; #ifndef _DEBUG cout << "Mail to:"; cin >> Mailto; cout << "Subject:" << endl; cin >> Subject; cout << "body:(end with EOF)" << endl; while(1) { getline(cin,buf); if(buf == "EOF") break; Body.append(buf); Body.append("\r\n"); } cout << "input the additional file path:" << endl; getline(cin,filepath); #endif #ifdef _DEBUG Mailto = "EricCN@126.com"; Subject = "addition test"; Body = "this is the body!\r\n"; filepath = "/root/C/filename"; #endif cout << "the mail is sending,please wait!" << endl; mymail.SetMailTo(Mailto); mymail.SetSubject(Subject); mymail.SetMailBody(Body); if(strlen(filepath.c_str()) > 0) mymail.SetFilePath(filepath); if(mymail.SendMail() < 0) cout << mymail.GetErr() <<endl; cout << "The mail has send succesfully!" << endl; return 1;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -