Fog Creek Software
Discussion Board




ole.obj embedding

When folk send our Fogbugz system an email, they more often than not paste a screenshot right into the body of the mail.

This shows up as

<<...OLE_Obj...>>

(Exchange 5.5 / Outlook 2k)

Any bright ideas out there short of saying 'don't do that, put it into a word doc'

Cheers,

Paul

Paul Morton
Friday, June 06, 2003

This is because (I believe) the mime part doesn't have a filename...

If the mime part is image/ something, then you can change the code in dlgbugediting.asp to make it work.

Look for the function FormatTextAsHTMLEmail..
change the whole big foreach block in there to this foreach block
---

            For Each part in msg.PartList
                If Len(part.Data) > 0 Then
                    If LCase(Left(part.Header.Find(msgContentType), Len("text/plain"))) <> "text/plain" And _
                      LCase(Left(part.Header.Find(msgContentType), Len("text/html")))  <> "text/html" Then
                        Set matches = re.Execute(part.Header.Find(msgContentType))
                        If matches.Count <= 0 Then
                            Set matches = re.Execute(part.Header.Find(msgContentDisposition))
                        End If
                        
                        sFileName = ""
                        If matches.Count > 0 Then
                            sFileName = matches(0).SubMatches(1)
                        ElseIf Left(part.Header.Find(msgContentType), Len("image/")) = "image/" Then
                            sFileName = "temp." & Right(part.Header.Find(msgContentType), Len(part.Header.Find(msgContentType)) - Len("image/"))
                        End If
                        
                        If Len(sFilename) > 0 Then
                            %>
                            <p>
                            <%
                            If InlineAttachment(sFileName) Then
                                %>
                                <a href="download.asp?ixBugEvent=<%=ev.ixBugEvent%>&sFileName=<%=FBURLPathEncode(sFileName)%>&sPart=<%=Server.URLEncode(part.Index)%>">
                                <img src="download.asp?ixBugEvent=<%=ev.ixBugEvent%>&sFileName=<%=FBURLPathEncode(sFileName)%>&sPart=<%=Server.URLEncode(part.Index)%>" border="0" inline="yes" />
                                </a>
                                <%
                            Else                        
                                %>
                                <a href="download.asp?ixBugEvent=<%=ev.ixBugEvent%>&sFileName=<%=FBURLPathEncode(sFileName)%>&sPart=<%=Server.URLEncode(part.Index)%>">
                                    <% AttachmentIcon False %>
                                    <%=sFileName%></a>
                                <%
                            End If
                            %> </p> <%
                        End If
                    End If
                End If
            Next

Michael H. Pryor
Friday, June 06, 2003

nope, sorry.

I did what my users seem to be doing - hit print screen and pasted it into the body of an RTF and then an HTML email

I still got the ole.obj message and no picture.

This seems to be the primary way folk submit screenshots to us through the system. I'd rather not have to go down the 'put it into a Word doc' route.

Thanks,

Paul Morton
Tuesday, June 10, 2003

Can you save a sample message sent to yourself as full text and paste the source in here (with the full headers and content-types, etc)?

Michael H. Pryor
Tuesday, June 10, 2003

*  Recent Topics

*  Fog Creek Home