MCPcopy Create free account
hub / github.com/acl-dev/acl / main

Function main

lib_acl_cpp/samples/smtp_client/main.cpp:111–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111int main(int argc, char* argv[])
112{
113 int ch;
114 bool use_ssl = false;
115 acl::string addr("smtp.263.net:25"), email_path;
116 acl::string sender("zsxxsz@263.net"), pass, recipients;
117
118 acl::acl_cpp_init();
119 acl::log::stdout_open(true);
120
121 while ((ch = getopt(argc, argv, "hs:u:p:t:ef:")) > 0)
122 {
123 switch (ch)
124 {
125 case 'h':
126 usage(argv[0]);
127 return 0;
128 case 's':
129 addr = optarg;
130 break;
131 case 'u':
132 sender = optarg;
133 break;
134 case 'p':
135 pass = optarg;
136 break;
137 case 't':
138 recipients = optarg;
139 break;
140 case 'e':
141 use_ssl = true;
142 break;
143 case 'f':
144 email_path = optarg;
145 break;
146 default:
147 break;
148 }
149 }
150
151 if (addr.empty() || sender.empty() || pass.empty() || recipients.empty())
152 {
153 usage(argv[0]);
154 return 1;
155 }
156
157 if (email_path.empty())
158 (void) send_mail(addr.c_str(), sender.c_str(), pass.c_str(),
159 recipients.c_str(), use_ssl);
160 else
161 (void) send_mail(addr.c_str(), sender.c_str(), pass.c_str(),
162 recipients.c_str(), email_path, use_ssl);
163
164#if defined(_WIN32) || defined(_WIN64)
165 getchar();
166#endif
167 return 0;
168}

Callers

nothing calls this directly

Calls 6

acl_cpp_initFunction · 0.85
send_mailFunction · 0.85
usageFunction · 0.70
getoptFunction · 0.50
emptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…