IMAP-Can not view contents in outlook - c++

i have implemented an IMAP client (using winsock and openssl) that can fetch emails from my GMail account and save each individual email as .eml file. However, i was not able to view the content using outlook.
I also tried EAgetmail to download email and i can view them in outlook.
http://imageshack.us/photo/my-images/16/eagetmail.png/?sa=0 "Eagetmail viewed in notepad"
http://postimg.org/image/ma635e0xx/ "Eagetmail viewed in outlook"
http://postimg.org/image/xo9piny5f/ "Winsock viewed in notepad"
http://postimg.org/image/oa8tvzo9v/ "winsock viewed in outlook"
I also tried to edit the content of so that it looks similar to the content of Eagetmail but it still does not work. However, if i copy and paste the entire content of EAgetmail then i was able to view it in outlook.

The actual text looks ok, i.e. looks like a correct MIME format. Since you're able to cut/paste it and have it load okay, I suspect something is wrong with the encoding of the file that gets cleared up on the clipboard. Maybe the line endings? Look at it with a hex editor in before and after paste to see what's different.

Related

Chilkat Email Object - Save email without attachments

I need to save the email without the attachments in EML format with Chilkat.
I'm using VB.NET and an IMAP connection and I have already checked SaveAllAttachments (that does the opposite saving only the attachments) and SaveEml (for email with attachments included).
'Attachments only
email.SaveAllAttachments(MyInPath)
'Email with attachments in EML format
email.SaveEml(MyInPath & "\" & email.GenerateFilename())
I'd like to keep a regular EML format (with header, sender, subject, body erc.) but without the attachments (so not just the body on a TXT file).
Is there a way to do it simply?
Someone who deleted his post (I don't know why) said to use email.DropAttachments() and posted this link:
https://www.chilkatsoft.com/refdoc/vbnetEmailRef.html
It's a little bit strange to save the whole email and then delete the attachments but it simply works

Google server is responding with an outdated html file

I'm learning socket programming using C++ , so as a project I thought of a software that downloads all image search results for a certain search(eg."cats"),
I'm using WinHttp and the exemple in here
and giving it :
the server name L"www.google.com"
object L"/search?q=cats&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiP9M3gtZTPAhXLKMAKHYSyDqIQ_AUICCgB&biw=1152&bih=634#q=cats&tbm=isch&tbs=isz:l "
The problem is that the HTML file in the response message contains what it seems to be an "Outdated" file That doesn't contain links to the real images, here it is (I can't give you the whole html file it's too long but here is an image
Research:
I first thought it was a user-agent problem so I added user-agent header, but it didn't work.
The Problem:
I want to get the same HTML result that I get when I search my browser for the same object
I found the problem it was the user-agent , just copied the user-agent from my browser

How does one determine the filetype on an AWS S3 hosted file without the extension?

As an example, I'm currently uploading items directly to an S3 bucket using a form. While I was testing, I didn't specify any expected filenames or extensions.
I uploaded a .png which produced this direct link:
https://s3-us-west-2.amazonaws.com/easyhighlighting2/2015-07-271438019663927upload94788
When I place this inside an img tag, it displays on a web page properly.
My question is, without an extension, how would my browser know what type of file it's loading? Inside the bucket, the file's metadata isn't even filled out.
Is there any way to get that file extension, programmatically?
I'm ready to try any clientside methods available; my server-side language is ColdFusion which is somewhat limiting, but I'm open to suggestions for that as well.
Okay, so after some more extensive digging, I found a method of retrieving the file's type that was only added since CF10 was released; that would explain the lack of documentation.
The answer lies in the FileGetMimeType function.
<cfset someVar = "https://s3-us-west-2.amazonaws.com/easyhighlighting2/2015-07-271438019663927upload94788">
<cfset FileType = FileGetMimeType(someVar)>
<cfoutput>#FileType#</cfoutput>
This code would output image/png - which is correct and has worked for every filetype I have tested thus far.
I'm surprised this kind of question hasn't popped up before, but this appears to be the best answer, at least for users of CFML.
Edit:
ColdFusion accomplishes this by either reading the contents of a file, or by trusting its extension. An implicit attribute, 'strict', is used in this function. If true, it reads the file's contents. If false, it uses the provided extension.
True is the default.
Link:
https://wikidocs.adobe.com/wiki/display/coldfusionen/FileGetMimeType
Check the Content-Type HTTP response header returned by Amazon S3.
For example, curl -I https://s3.amazonaws.com/path/to/file fetches only the headers.

How do I create text file for Confluence and then import it as a Confluence wiki page?

Here is what I want to accomplish:
I am writing a script which will parse some source code, extract some comments that I want it to extract and I will store this text in a text file.
I want to write another script that uses the content of this text file to be programatically transformed into a Confluence wiki-page.
Please tell me the best way to do this. I already saw this
I felt that I could change the input in the above example to take input from text file and update contents of Confluence page. But, I am not sure how it will be formatted. If I have to format it, what do I need to do?
Thanks in advance!
As an alternative to XML-RPC you can use the integrated WebDAV plugin.
Write a script that creates a directory in the selected space.
The directory name will be the page name. After creating the directory a text-file with the same name (with .txt extension) will be created in the directory which holds the content of the page
let your script edit this file in insert the content of your text-file.
Information about the usage of the plugin:
Configuring a WebDAV client for Confluence
Confluence WebDAV Plugin
Troubleshooting WebDAV
I Also saw the code you are referring to. I tweaked it a bit a produced the following code that me help you for the second part of your question.
My code creates a new space and also a new page from a text file that is inserted in the previously created space.
import sys
import xmlrpc.client
import os
import re
# Connects to confluence server with username and password
site_URL = "YOUR_URL"
server = xmlrpc.client.ServerProxy(site_URL + "/rpc/xmlrpc")
username = "YOUR_USERNAME"
pwd = "YOUR_PASSWORD"
token = server.confluence2.login(username, pwd)
# The space you want to add a page to
spacekey = "YOUR_SPACENAME"
# Retrives text from a file
f = open('FileName.txt', 'r')
content = f.read()
f.close()
# Creates a new page to insert in the new space from text file content
newpage = {"title":"NEW_PAGENAME", "space":spacekey, "content":content}
server.confluence2.storePage(token, newpage)
server.confluence2.logout(token)
For your formatting issues, html is supported, but I have not quite figured out how to use CSS styles other than inline (everthing else does not seem to work).
These styles work when you write them with the HTML macro inside Confluence, but from the remote API, it does not seem to behave the same way.
UPDATE :
You can use the {html} macro to include your html by using :
content = server.confluence2.convertWikiToStorageFormat(token, content)
You can also specify your CSS in your global CSS stylesheet.
Another option is to develop a plugin to include a CSS resource :
https://developer.atlassian.com/display/CONFDEV/Creating+a+Stylesheet+Theme
I have tried this way and works petty well for me:
I used a Java program to created a programmatic client to create the dynamic content. This created a HTML document out of my plain text.
I used a RPC client connected to Confluence to uploaded it as a new page.
Your html will be preserved. But if you want to add CSS or JS/JQuery etc on top of your html you will need to create a Macro and enable it for the Particular page. This feature is not available in Confluence OnDemand.

How to Check if a website contains Flash

I've created a web browser using mfc and i'm using IHhmlReader to read the contents of html when the user enters a url in the browser and page is completely loaded.Now i want to check if the webpage has any flash in it.
Any Helps would be highly appreciated.
Thank You.
I think this is a bit difficult to do, just reading from the HTML source, unless you try to instantiate the page and see if it's making a call to the Flash object. I have listed some options you can try, but you'll need to make sure that the code element is not commented out and check include files and iframes to see if Flash is called from there.
* Look for the OBJECT and EMBED tags (see http://kb2.adobe.com/cps/127/tn_12701.html)
* In page's JavaScript, look for SWFObject() call
* Look for the call to .swf file (could even be in an img tag)
Good luck...