링크 : http://www.codeproject.com/Articles/28806/SMTP-Client
[사용법]
#include "CSmtp.h"
#include <iostream>
int main()
{
bool bError = false;
try
{
CSmtp mail;
mail.SetSMTPServer("smtp.domain.com",25);
mail.SetLogin("***");
mail.SetPassword("***");
mail.SetSenderName("User");
mail.SetSenderMail("user@domain.com");
mail.SetReplyTo("user@domain.com");
mail.SetSubject("The message");
mail.AddRecipient("friend@domain2.com");
mail.SetXPriority(XPRIORITY_NORMAL);
mail.SetXMailer("The Bat! (v3.02) Professional");
mail.AddMsgLine("Hello,");
mail.AddMsgLine("");
mail.AddMsgLine("How are you today?");
mail.AddMsgLine("");
mail.AddMsgLine("Regards");
mail.AddMsgLine("--");
mail.AddMsgLine("User");
mail.AddAttachment("c:\\test.exe");
mail.AddAttachment("c:\\test2.jpg");
mail.Send();
}
catch(ECSmtp e)
{
std::cout << "Error: " << e.GetErrorText().c_str() << ".\n";
bError = true;
}
if(!bError)
{
std::cout << "Mail was send successfully.\n";
return 0;
}
else
return 1;
}
'MFC' 카테고리의 다른 글
[MFC] HRESULT 반환값 (0) | 2014.01.16 |
---|---|
[MFC] Web Browser Control FAQ (0) | 2013.11.21 |
[MFC] Excel파일 MFC에서 읽기(OLEDB) 예제 (0) | 2012.09.25 |
[MFC] Dialog에 ScrollView,View 붙이기 (0) | 2012.06.21 |
[MFC] MFC 샘플 코드 모음 (0) | 2012.05.04 |