OSDN Git Service

Complete Send mail coding and mail send have some problem.
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / Commands / SendMailCommand.cpp
1 #include "StdAfx.h"\r
2 #include "SendMailCommand.h"\r
3 #include "SendMailDlg.h"\r
4 #include "SVNProgressDlg.h"\r
5 \r
6 bool SendMailCommand::Execute()\r
7 {\r
8         CSendMailDlg dlg;\r
9 \r
10         dlg.m_PathList  = orgPathList;\r
11         \r
12         if(dlg.DoModal()==IDOK)\r
13         {\r
14                 if(dlg.m_PathList.GetCount() == 0)\r
15                         return FALSE;\r
16         \r
17                 CGitProgressDlg progDlg;\r
18                 \r
19                 theApp.m_pMainWnd = &progDlg;\r
20                 progDlg.SetCommand(CGitProgressDlg::GitProgress_SendMail);\r
21                                 \r
22                 if (parser.HasVal(_T("closeonend")))\r
23                                 progDlg.SetAutoClose(parser.GetLongVal(_T("closeonend")));\r
24                 \r
25                 progDlg.SetPathList(dlg.m_PathList);\r
26                                 //ProjectProperties props;\r
27                                 //props.ReadPropsPathList(dlg.m_pathList);\r
28                                 //progDlg.SetProjectProperties(props);\r
29                 progDlg.SetItemCount(dlg.m_PathList.GetCount());\r
30 \r
31                 DWORD flags =0;\r
32                 if(dlg.m_bAttachment)\r
33                         flags |= SENDMAIL_ATTACHMENT;\r
34                 if(dlg.m_bCombine)\r
35                         flags |= SENDMAIL_COMBINED;\r
36 \r
37                 progDlg.SetSendMailOption(dlg.m_To,dlg.m_CC,flags);\r
38                 \r
39                 progDlg.DoModal();              \r
40 \r
41                 return true;\r
42         }\r
43         return false;\r
44 }