C ++ LibcURL IMAP提取保存主题行的变量是什么? [英] C++ LibcURL IMAP fetch what is the variable holding the subject line?

查看:88
本文介绍了C ++ LibcURL IMAP提取保存主题行的变量是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

代码为 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;
}

推荐答案

您可以使用仅检索主题的URL.

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)");

某些关于imap + libcurl的现有问题可能也会使您感兴趣. (该链接的标记/标记+标记"格式是在SO,BTW上查找内容的好方法.)

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.)

这篇关于C ++ LibcURL IMAP提取保存主题行的变量是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆