问题
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