smtp发送邮件类(支持SSL)

上传者: zhangliuxue | 上传时间: 2021-08-23 17:01:37 | 文件大小: 1.33MB | 文件类型: RAR
//初始化邮件类 void InitEmail(C01waSendMail* m_globalEmail,String sendermail,String sender,String senderpwd,String srv,int port = 25,bool bSsl = false) { m_globalEmail->m_Auth = CPJNSMTPConnection::AuthenticationMethod::AUTH_AUTO; m_globalEmail->m_bAutoDial = true; m_globalEmail->m_bSSL = bSsl; m_globalEmail->m_sUsername = sender.c_str(); m_globalEmail->m_sAddress = sendermail.c_str(); m_globalEmail->m_sPassword = senderpwd.c_str(); m_globalEmail->m_sHost = srv.c_str(); m_globalEmail->m_nPort = port; m_globalEmail->m_sEncodingFriendly = _T("Chinese Simplified (GB2312)"); m_globalEmail->m_sEncodingCharset = _T("gb2312"); m_globalEmail->m_bMime = 1; m_globalEmail->m_bHTML = 1; m_globalEmail->m_Priority = CPJNSMTPMessage::PRIORITY::NormalPriority; m_globalEmail->m_bDSN = FALSE; m_globalEmail->m_bDSNSuccess = FALSE; m_globalEmail->m_bDSNFailure = FALSE; m_globalEmail->m_bDSNDelay = FALSE; m_globalEmail->m_bDSNHeaders = FALSE; m_globalEmail->m_bDNSLookup = FALSE; } //发送邮件 void SendEmail(const char* recvemail,const char* subject,const char* body,const char * sCC=NULL,const char * bCC = NULL,const char * attach = NULL) { //初始化邮箱 //注意释放内存 C01waSendMail *m_globalEmail = new C01waSendMail; if(strlen(m_con1.m_eamil)>0&&strlen(m_con1.m_pwd)&&strlen(m_con1.m_smtpsrv)&&m_con1.port>0) { char * p = strdup(m_con1.m_eamil); char * pp = strstr(p,"@"); if(pp>0) pp[0] = '\0'; InitEmail(m_globalEmail,m_con1.m_eamil,p,m_con1.m_pwd,m_con1.m_smtpsrv,m_con1.port,m_con1.ssl); free(p); if(subject>0) m_globalEmail->m_sSubject.Format("%s",subject); if(sCC>0) m_globalEmail->m_sCC.Format("%s",sCC); if(bCC>0) m_globalEmail->m_sBCC.Format("%s",bCC); if(body>0) m_globalEmail->m_sBody.Format("%s",body); if(attach>0) m_globalEmail->m_sFile.Format("%s",attach); if(recvemail>0) m_globalEmail->m_sTo.Format("%s",recvemail); m_globalEmail->SendEmail(); } }

文件下载

资源详情

[{"title":"( 88 个子文件 1.33MB ) smtp发送邮件类(支持SSL)","children":[{"title":"sendemail","children":[{"title":"main.cpp <span style='color:#111;'> 1.36KB </span>","children":null,"spread":false},{"title":"SocMFC.h <span style='color:#111;'> 4.99KB </span>","children":null,"spread":false},{"title":"resource.h <span style='color:#111;'> 3.80KB </span>","children":null,"spread":false},{"title":"OpenSSLMfc.cpp <span style='color:#111;'> 6.05KB </span>","children":null,"spread":false},{"title":"PJNNTLMAuth.h <span style='color:#111;'> 3.30KB </span>","children":null,"spread":false},{"title":"PJNNTLMAuth.cpp <span style='color:#111;'> 9.51KB </span>","children":null,"spread":false},{"title":"01waSendMail.h <span style='color:#111;'> 1.11KB </span>","children":null,"spread":false},{"title":"CSendLicByEmail.cpp <span style='color:#111;'> 3.00KB </span>","children":null,"spread":false},{"title":"01waSendMail.cpp <span style='color:#111;'> 11.35KB </span>","children":null,"spread":false},{"title":"SocMFC.cpp <span style='color:#111;'> 32.83KB </span>","children":null,"spread":false},{"title":"PJNMD5.h <span style='color:#111;'> 7.39KB </span>","children":null,"spread":false},{"title":"PJNSmtp.cpp <span style='color:#111;'> 93.68KB </span>","children":null,"spread":false},{"title":"iStdAfx.h <span style='color:#111;'> 1.43KB </span>","children":null,"spread":false},{"title":"iStdAfx.cpp <span style='color:#111;'> 26B </span>","children":null,"spread":false},{"title":"openssl","children":[{"title":"include","children":[{"title":"openssl","children":[{"title":"pqueue.h <span style='color:#111;'> 3.44KB </span>","children":null,"spread":false},{"title":"ossl_typ.h <span style='color:#111;'> 6.30KB </span>","children":null,"spread":false},{"title":"des.h <span style='color:#111;'> 10.47KB </span>","children":null,"spread":false},{"title":"pkcs12.h <span style='color:#111;'> 12.38KB </span>","children":null,"spread":false},{"title":"evp.h <span style='color:#111;'> 33.15KB </span>","children":null,"spread":false},{"title":"dso.h <span style='color:#111;'> 15.87KB </span>","children":null,"spread":false},{"title":"hmac.h <span style='color:#111;'> 4.27KB </span>","children":null,"spread":false},{"title":"ec.h <span style='color:#111;'> 20.65KB </span>","children":null,"spread":false},{"title":"pq_compat.h <span style='color:#111;'> 6.00KB </span>","children":null,"spread":false},{"title":"dsa.h <span style='color:#111;'> 10.07KB </span>","children":null,"spread":false},{"title":"rsa.h <span style='color:#111;'> 16.60KB </span>","children":null,"spread":false},{"title":"asn1t.h <span style='color:#111;'> 27.19KB </span>","children":null,"spread":false},{"title":"idea.h <span style='color:#111;'> 4.26KB </span>","children":null,"spread":false},{"title":"md5.h <span style='color:#111;'> 4.53KB </span>","children":null,"spread":false},{"title":"safestack.h <span style='color:#111;'> 119.51KB </span>","children":null,"spread":false},{"title":"ocsp.h <span style='color:#111;'> 23.30KB </span>","children":null,"spread":false},{"title":"crypto.h <span style='color:#111;'> 21.60KB </span>","children":null,"spread":false},{"title":"applink.c <span style='color:#111;'> 2.54KB </span>","children":null,"spread":false},{"title":"krb5_asn.h <span style='color:#111;'> 7.46KB </span>","children":null,"spread":false},{"title":"cast.h <span style='color:#111;'> 4.25KB </span>","children":null,"spread":false},{"title":"asn1.h <span style='color:#111;'> 45.01KB </span>","children":null,"spread":false},{"title":"ripemd.h <span style='color:#111;'> 4.17KB </span>","children":null,"spread":false},{"title":"rc4.h <span style='color:#111;'> 3.62KB </span>","children":null,"spread":false},{"title":"engine.h <span style='color:#111;'> 36.92KB </span>","children":null,"spread":false},{"title":"blowfish.h <span style='color:#111;'> 4.96KB </span>","children":null,"spread":false},{"title":"ssl23.h <span style='color:#111;'> 3.66KB </span>","children":null,"spread":false},{"title":"comp.h <span style='color:#111;'> 1.56KB </span>","children":null,"spread":false},{"title":"stack.h <span style='color:#111;'> 4.32KB </span>","children":null,"spread":false},{"title":"ebcdic.h <span style='color:#111;'> 541B </span>","children":null,"spread":false},{"title":"des_old.h <span style='color:#111;'> 17.80KB </span>","children":null,"spread":false},{"title":"rc2.h <span style='color:#111;'> 4.19KB </span>","children":null,"spread":false},{"title":"pkcs7.h <span style='color:#111;'> 15.95KB </span>","children":null,"spread":false},{"title":"ui_compat.h <span style='color:#111;'> 3.36KB </span>","children":null,"spread":false},{"title":"ssl3.h <span style='color:#111;'> 21.50KB </span>","children":null,"spread":false},{"title":"conf.h <span style='color:#111;'> 9.22KB </span>","children":null,"spread":false},{"title":"dtls1.h <span style='color:#111;'> 6.04KB </span>","children":null,"spread":false},{"title":"symhacks.h <span style='color:#111;'> 19.00KB </span>","children":null,"spread":false},{"title":"txt_db.h <span style='color:#111;'> 4.20KB </span>","children":null,"spread":false},{"title":"store.h <span style='color:#111;'> 25.86KB </span>","children":null,"spread":false},{"title":"err.h <span style='color:#111;'> 12.20KB </span>","children":null,"spread":false},{"title":"md4.h <span style='color:#111;'> 4.53KB </span>","children":null,"spread":false},{"title":"md2.h <span style='color:#111;'> 3.79KB </span>","children":null,"spread":false},{"title":"dh.h <span style='color:#111;'> 8.05KB </span>","children":null,"spread":false},{"title":"ecdsa.h <span style='color:#111;'> 10.29KB </span>","children":null,"spread":false},{"title":"ui.h <span style='color:#111;'> 16.03KB </span>","children":null,"spread":false},{"title":"sha.h <span style='color:#111;'> 7.14KB </span>","children":null,"spread":false},{"title":"x509_vfy.h <span style='color:#111;'> 20.25KB </span>","children":null,"spread":false},{"title":"e_os2.h <span style='color:#111;'> 9.21KB </span>","children":null,"spread":false},{"title":"opensslv.h <span style='color:#111;'> 3.66KB </span>","children":null,"spread":false},{"title":"aes.h <span style='color:#111;'> 4.76KB </span>","children":null,"spread":false},{"title":"rand.h <span style='color:#111;'> 5.13KB </span>","children":null,"spread":false},{"title":"ssl.h <span style='color:#111;'> 77.71KB </span>","children":null,"spread":false},{"title":"objects.h <span style='color:#111;'> 32.61KB </span>","children":null,"spread":false},{"title":"pem.h <span style='color:#111;'> 27.71KB </span>","children":null,"spread":false},{"title":"bio.h <span style='color:#111;'> 29.89KB </span>","children":null,"spread":false},{"title":"lhash.h <span style='color:#111;'> 7.26KB </span>","children":null,"spread":false},{"title":"bn.h <span style='color:#111;'> 31.47KB </span>","children":null,"spread":false},{"title":"kssl.h <span style='color:#111;'> 5.79KB </span>","children":null,"spread":false},{"title":"buffer.h <span style='color:#111;'> 4.46KB </span>","children":null,"spread":false},{"title":"tls1.h <span style='color:#111;'> 14.01KB </span>","children":null,"spread":false},{"title":"x509.h <span style='color:#111;'> 46.71KB </span>","children":null,"spread":false},{"title":"ssl2.h <span style='color:#111;'> 10.47KB </span>","children":null,"spread":false},{"title":"x509v3.h <span style='color:#111;'> 24.85KB </span>","children":null,"spread":false},{"title":"conf_api.h <span style='color:#111;'> 3.99KB </span>","children":null,"spread":false},{"title":"tmdiff.h <span style='color:#111;'> 4.02KB </span>","children":null,"spread":false},{"title":"asn1_mac.h <span style='color:#111;'> 18.51KB </span>","children":null,"spread":false},{"title":"pem2.h <span style='color:#111;'> 2.80KB </span>","children":null,"spread":false},{"title":"opensslconf.h <span style='color:#111;'> 5.96KB </span>","children":null,"spread":false},{"title":"ecdh.h <span style='color:#111;'> 4.50KB </span>","children":null,"spread":false},{"title":"obj_mac.h <span style='color:#111;'> 106.68KB </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"lib","children":[{"title":"libeay32.lib <span style='color:#111;'> 3.74MB </span>","children":null,"spread":false},{"title":"ssleay32.lib <span style='color:#111;'> 670.29KB </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"PJNSmtp.h <span style='color:#111;'> 22.37KB </span>","children":null,"spread":false},{"title":"OpenSSLMfc.h <span style='color:#111;'> 3.88KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}]

评论信息

  • gdouchenxx :
    没参考价值
    2017-09-04
  • yedejian1 :
    C/c++的 用不了 想找C# 的
    2016-07-16
  • djf_1985 :
    能使用,不过发送附近时候有点问题,调试时候改下就OK
    2015-01-07
  • fan20065 :
    能用,感觉写的略微有点复杂。。
    2014-11-04
  • liuzyan :
    想在Linux上面用,要自己改了。不知道支不支持发送图片
    2014-10-13

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明