Hobby Chef

September, 2008 - Jive into Messaging world - Site Home - MSDN Blogs

Blog - Title

September, 2008

  • Jive into Messaging world

    ERROR: ActiveX component can't create object (MAPI.Session) on Vista

    • 2 Comments

    Make sure you have installed CDO 1.21 which comes separately and no longer ships with Outlook 2007

    Download it here : http://www.microsoft.com/downloads/details.aspx?FamilyID=2714320d-c997-4de1-986f-24f081725d36&DisplayLang=en

    if you are running it on Exchange 2007 server then you need Exchange Server version of it, which can be found here : http://www.microsoft.com/downloads/details.aspx?familyid=E17E7F31-079A-43A9-BFF2-0A110307611E&displaylang=en

    Still getting the same error??? Are you running 64bit version of Vista and you application is 64bit... stop there!

    CDO 1.21 is 32bit ONLY it will not run under 64 bit. So make sure you run your application under 32bit

    If this is a VBScript or JavaScript code running under cmd.exe or Internet Explorer, make sure you have host application running as 32bit

    for cscript or wscript version of 32bit launch them from C:\windows\syswow64\cscript.exe (or wscript.exe)

    32bit version of IE can be found here - c:\Program Files (x86)\Internet Explorer\iexplore.exe

     Just one more thing to check if you are running in IE7 and above... You cant create objects in "Protected Mode". Turn it off before you run your script.

    And lowering security settings is bad, anything  page could run code if you allow it. This means your machines could be taken over by code from any malicious web site.  This should be considered before turning it off against.   You “May” be able to put it into a signed active control and then have IE only allow signed active X controls. However, you should consider alternatives ways to run your code. Why cant you run outside of IE or have Web code do it in other way?

  • Jive into Messaging world

    HOW IT WORKS: Why my MSG files are getting converted to inline attachments ?

    • 2 Comments

    You might have faced this issue if you have used Outlook to send emails to SMTP recipients (non-exchange). Whenever you attach any MSG file to attachments it gets converted to inline attachment for the recipients. It made my colleague Akash worried why its happening and I have to explain him Why.

    Here is the story...

    Outlook and Exchange both are responsible for content conversation on the basis of protocol being used. If it’s MAPI (Outlook connecting to Exchange), Outlook will not touch the MSG file and sent it as-is while in the case of SMTP it will convert the MSG file into rfc822, send the email in MIME format and attach the rfc822 onto it. Similarly, when you use OWA to send email and attach MSG file to the it, it is not converted as OWA sends the mail in MIME and not MAPI format. While OWA sends the email in MIME it attach the MSG file as application/octet-stream instead of text/rfc822

    I will try to explain in scenario basis

    1) Outlook <-> Exchange

    You created a new email message and sent it to Exchange for local delivery (same server/mailbox) the attached MSG file is not converted and delivered as-is, end result will be you see it as attached

    2) Outlook =>(via MAPI)=>Exchange=> SMTP (Gmail / Hotmail/Another Exchange Server)

    In this scenario the protocol is SMTP, even if Exchange is connecting to another Exchange. SMTP mails are always in rfc822, this time the responsibility of content conversion is not of Outlook because it is handing over the MSG to Exchange who can understand and convert the message if required. The content conversion takes place at Exchange’s end when the email is leaving Exchange and comes to SMTP protocol. This time exchange will convert the MSG to html email and wrap it in a rfc822 message. Gmail/Hotmail being HTML clients and capable of handling rfc822 format will read through the rfc822 and display it’s content.

    3) Outlook=>(via SMTP)=>Gmail/Hotmail

    There is no exchange and Outlook cannot be sure that the recipient of MSG file will be able to interpret is because the protocol is SMTP. So it’s a logical responsibility of Outlook to convert its proprietary format into standard format which can be understood by SMTP clients , rfc822. Copy-Paste from above scenario, This time Outlook will convert the MSG to html email and wrap it in a rfc822 message. Gmail/Hotmail being HTML clients and capable of handling rfc822 format will read through the rfc822 and display it’s content.

    So it is entirely up to the client at recipients’ end how to interpret the rfc822 and display it. If you use Outlook to download the same email from Gmail’s Inbox ,the one which shows as inline in Gmail, will be rendered as attachment in Outlook. Why does CDOSYS or OWA plays different role with same MSG file??? because it does not know how to handle MSG files. CDOSYS and OWA sends email in MIME, for them it is just another binary file which is attached as application/octet-stream to MIME message.

    If you still have any questions, feel free to contact me.

Page 1 of 1 (2 items)