网易免费/付费163企业邮smtp服务器地址

免费:smtp.ym.163.com 25/pop.ym.163.com 110

付费:smtp.qiye.163.com 25/pop.qiye.163.com 110

转载于:https://www.cnblogs.com/EasonJim/p/6178836.html

//初始化件类 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(); } }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值