Archive for the ‘E-mail’ Category

Xobni feedback: Limited contact information

January 16, 2008

Xobni will only let you store one phone number per person. But what if someone has a work number, home number and a cell phone, and you decide what to use based of his daily schedule and the time of the day?

It would be very convenient to be able to assign several number to a person, and then, when this person is displayed in the Xobni side bar, all his numbers would be displayed, and you could choose what to use.

Another problem with person contact is that when you edit it and add a number, you loose the information Xobni collected from e-mails, so if you added a picture for a person, or mistakenly set a phone number for him, you have no way to ask Xobni to use the person contact details it gathered from e-mails.

There should be an option to tell Xobni to revert back to use data from e-mails, and also there should be a way to edit this information or to add data like picture without affecting this information.

A solution to quickly moving mail items from Outlook inbox

June 12, 2007

My usual way of handling e-mails is reading them in the inbox which collects both work-related e-mails from the Exchange server and private e-mails from my Gmail inbox using SMTP and POP3., and then dragging them to the the appropriate folder in one of the PST I have.

I know that since I index my mails and it is lightning fast to find any e-mail filing each e-mail in a specific related folder is less important, but kind of used to it, and I still find it useful to be able to go to a folder and see all the mails that I decided that belong to that folder, and not all the files that match some search. This has prove itself useful mainly in customer related data, where searching the customer name would have bring way too many mails, but looking at the customer folder quickly revealed the old case I was looking for. By the way, these is one of the reason I prefer Outlook to Gmail. Outlook can easily help me categorize my mails in hundreds of hierarchical folders, where Gmail provides a flat list of labels, which might not be useful for more than a few dozens.

My problem was that whenever I wanted to move a mail to a folder, I would have to find the folder in the folders tree, in order to drag the mail into it. This might be annoying for commonly used  folders like the folder that keeps mails from CodeProject (I’m subscribed to it although I rarely develop in Microsoft technologies. I enjoy skimming through it looking at what’s new in that area. Occasionally I even find an interesting article).

When a mail is opened in Outlook editor, which has the new ribbon, the ribbon has a clever Move to Folder item which opens a list of recently used folders. However, if I don’t want to open the mail, and only want to move it to a folder from the index, I have to find the folder in the tree and drag it to it.

One solution is to use the Favorite Folders to put shortcut to commonly used folders in a fixed place, and then drag mails to that folder shortcut, and not to its location in the tree. This has two drawbacks:

  1. The list tends to grow all the time, and I end up with a big list of “Favorite Folders” which I rarely ever navigate to – I only use them as drag targets.
  2. Sometimes Outlook crashes and the list of Favorites folder is reset, and I have to start building it from scratch.

Today I came up with a new solution – use macros.

I wrote the following VBA procedure:

Private Sub MoveItemsToFolder(folderID As String)
    Dim item As MailItem
    Dim targetFolder As Folder
    ' Folder ID can be obtained by selecting the folder
    ' in Outlook and then typing in the immediate window:
    '   ?ActiveExplorer.CurrentFolder.EntryID
    Set targetFolder = GetNamespace("MAPI").GetFolderFromID(folderID)
    If ActiveExplorer.CurrentFolder = targetFolder Then
        MsgBox "You are already in '" & targetFolder.Name & "'.", vbCritical
        Exit Sub
    End If

    For Each item In ActiveExplorer.Selection
        item.Move targetFolder
    Next item
End Sub

and then I wrote small procedures like the following:

Sub MoveToPrivate()
    MoveItemsToFolder "0000000045DC3C0FFF1EA54CBAD9147BB26AF269A2800000"
End Sub

Sub MoveToCodeProject()
    MoveItemsToFolder "00000000A7E4D138E838B7489BA3F839949B055122860000"
End Sub

Then I created a new menu in Outlook toolbar, and added these procedures as items to this toolbar menu. So now, when I want to move a mail to a folder, I simply select it and click the appropriate button.

As the comment says, if a new folder is needed, I select it and open the VBA editor, and type


in the immediate window. I didn’t have an Outlook crash yet, so I don’t yet know if crashes that reset the favorite folders also reset toolbar customization, but at least the first problem is solved – my favorite folders only contains folder I navigate to regularly, and not all the folder I periodically get mails that should be filed under them.

Strange problem on Vista’s Windows Mail

March 11, 2007

Our product contains an ActiveX that is used to create a mail message so the users can easily send custom data from our application.

Our code uses Simple MAPI’s MAPISendMail function to create the message. When it initialize the MapiMessage parameter we always pass the same arrays for the lpRecips and lpFiles members, but only if we need to pass actual recipients or files we initialize them. If not, they are not initialized, but this does not have to be a problem, since we pass 0 in the nRecipCount and nFileCount members.

And, indeed, there was never a problem with it, until our QA started testing our product on Windows Vista and found out that e-mail messages are not created when there are no attachments.

I checked it and found out that MAPISendMail returned MAPI_E_FAILURE which is a general error code with no real explanation. Playing with it some more I realized that the function, for some reason, looks into the lpFiles array, even though the nFileCount member is 0.

The fix was quite simple – pass a null pointer when nFileCount is 0, but this seems like a plain bug.

BTW, although I don’t plan to install Vista in the near future after what I’ve heard about it, I was really impressed with some of the small UI improvements in Vista’s File Explorer, and might give it a second thought in the not-so-near future.

Funny unintended strikethrough in a HTML e-mail

June 18, 2006

I'm subscribed to a newsletter from Realistic Religious Zionism. In the last e-mail I got, there was a strikethrough styling in the middle of the text. At first, I thought it is some kind of a correction, but then I noticed it continued to the end of the e-mail, so I realized this was some sort of a bug.

Out of curiosity, I viewed the HTML mail source, but this was cluttered with many formatted <p>s and <span>s, so I couldn't find anything there. In particular, I didn't find the text "strike" in the text.

I saved it as an HTML file and opened it in Firefox, and the problem still existed, so I tried checking it with Firebug and saw that when the problem started, an <s> element was defined with a pan attribute. I tried to look for an "<s " in the source to find out where it is defined, but couldn't find it either.

So, having no other choice, I looked for the location of the problem in the source. This was a bit problematic since it was a mixture of an English markup and a Hebrew text. When I nailed it down, I realized what the problem is. It appears that the mail text is cut every 1048 characters, and a new line is entered. Normally, this is not a problem, since white-spaces don't count in HTML. But when it occurs in the middle of a <span> tag definition, it renders an <s> tag with a pan attribute. I didn't know that, but <s> HTML tag can be used as the <strike> tag to specify stricken-through text (BTW, both tags are deprecated by the HTML standard and the CSS alternative is encouraged). Since the <span> tag definition was truncated with a new-line after the "<s", it was considered as the definition of an <s> tag, which wasn't really closed, so it lasted till the end of the e-mail.

This problem of cutting HTML in the middle is not mentioned in the list of problems with HTML e-mails. I guess the simplest solution is just to make every HTML markup in a new line. This makes the e-mail a bit longer, but avoids such problems. However, I guess they are using some rich text editor that generates this HTML e-mail, so I don't really know what can be done with that tool.