C++ LibcURL IMAP fetch what is the variable holding the subject line?

Deadly 提交于 2019-12-13 03:18:25

问题


Code is https://curl.haxx.se/libcurl/c/imap-fetch.html

In that example what would be variable holding the Subject line be. It prints it out in the console but I would like to be able to compare the content of the subject. For instance if I wanted to:

    If (subject == "sample text") {
Do things;
}

回答1:


You can use a URL that retrieves only the subject, if that's what you want.

curl_easy_setopt(curl, CURLOPT_URL,
                 "imap://imap.example.com/INBOX/;UID=1;SECTION=HEADER.FIELDS%20(Subject)");

Some of the existing questions about imap+libcurl may also interest you. (That "tagged/tag+tag" format of that link is a great way to find things on SO, BTW.)



来源:https://stackoverflow.com/questions/57983150/c-libcurl-imap-fetch-what-is-the-variable-holding-the-subject-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!