<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Fetching mail with Excel attachment fails in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Fetching-mail-with-Excel-attachment-fails/m-p/2331994#M100920</link>
    <description>Hey, 
&lt;BR /&gt;when sending data from Excel the content of the file is filled into the message directly, this is indicated from the MIME type. So there is no attachment and therefore Talend cannot pickup anything. I don't know if Excel has some configuration about how to send it. 
&lt;BR /&gt;Of course you could make it done by writing simple VBA module (ALT + F11) and connect it to custom button in Excel GUI. 
&lt;BR /&gt;Following code will save Active workbook, send it in Outlook way (message with attachment): 
&lt;BR /&gt; 
&lt;PRE&gt;Sub Save_and_Mail_workbook_Outlook()&lt;BR /&gt;'Working in 2000-2010&lt;BR /&gt;    Dim wb1 As Workbook&lt;BR /&gt;    Dim wb2 As Workbook&lt;BR /&gt;    Dim TempFilePath As String&lt;BR /&gt;    Dim TempFileName As String&lt;BR /&gt;    Dim FileExtStr As String&lt;BR /&gt;    Dim OutApp As Object&lt;BR /&gt;    Dim OutMail As Object&lt;BR /&gt;    Set wb1 = ActiveWorkbook&lt;BR /&gt;    If Val(Application.Version) &amp;gt;= 12 Then&lt;BR /&gt;        If wb1.FileFormat = 51 And wb1.HasVBProject = True Then&lt;BR /&gt;            MsgBox "There is VBA code in this xlsx file, there will" &amp;amp; vbNewLine &amp;amp; _&lt;BR /&gt;                   "be no VBA code in the file you send. Save the" &amp;amp; vbNewLine &amp;amp; _&lt;BR /&gt;                   "file first as xlsm and then try the macro again.", vbInformation&lt;BR /&gt;            Exit Sub&lt;BR /&gt;        End If&lt;BR /&gt;    End If&lt;BR /&gt;    With Application&lt;BR /&gt;        .ScreenUpdating = False&lt;BR /&gt;        .EnableEvents = False&lt;BR /&gt;    End With&lt;BR /&gt;    'Make a copy of the file/Open it/Mail it/Delete it&lt;BR /&gt;    'If you want to change the file name then change only TempFileName&lt;BR /&gt;    TempFilePath = Environ$("temp") &amp;amp; "\"&lt;BR /&gt;    TempFileName = "Copy of " &amp;amp; wb1.Name &amp;amp; " " &amp;amp; Format(Now, "dd-mmm-yy h-mm-ss")&lt;BR /&gt;    FileExtStr = "." &amp;amp; LCase(Right(wb1.Name, _&lt;BR /&gt;                                   Len(wb1.Name) - InStrRev(wb1.Name, ".", , 1)))&lt;BR /&gt;    wb1.SaveCopyAs TempFilePath &amp;amp; TempFileName &amp;amp; FileExtStr&lt;BR /&gt;    Set wb2 = Workbooks.Open(TempFilePath &amp;amp; TempFileName &amp;amp; FileExtStr)&lt;BR /&gt;    Set OutApp = CreateObject("Outlook.Application")&lt;BR /&gt;    Set OutMail = OutApp.CreateItem(0)&lt;BR /&gt;    On Error Resume Next&lt;BR /&gt;    With OutMail&lt;BR /&gt;        .To = "ron@debruin.nl"&lt;BR /&gt;        .CC = ""&lt;BR /&gt;        .BCC = ""&lt;BR /&gt;        .Subject = "This is the Subject line"&lt;BR /&gt;        .Body = "Hi there"&lt;BR /&gt;        .Attachments.Add wb2.FullName&lt;BR /&gt;        'You can add other files also like this&lt;BR /&gt;        '.Attachments.Add ("C:\test.txt")&lt;BR /&gt;        .Send   'or use .Display&lt;BR /&gt;    End With&lt;BR /&gt;    On Error GoTo 0&lt;BR /&gt;    wb2.Close SaveChanges:=False&lt;BR /&gt;    'Delete the file&lt;BR /&gt;    Kill TempFilePath &amp;amp; TempFileName &amp;amp; FileExtStr&lt;BR /&gt;    Set OutMail = Nothing&lt;BR /&gt;    Set OutApp = Nothing&lt;BR /&gt;    With Application&lt;BR /&gt;        .ScreenUpdating = True&lt;BR /&gt;        .EnableEvents = True&lt;BR /&gt;    End With&lt;BR /&gt;End Sub&lt;/PRE&gt; 
&lt;BR /&gt;Ladislav</description>
    <pubDate>Wed, 30 Nov 2011 19:24:42 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-11-30T19:24:42Z</dc:date>
    <item>
      <title>Fetching mail with Excel attachment fails</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Fetching-mail-with-Excel-attachment-fails/m-p/2331993#M100919</link>
      <description>Hello all,&lt;BR /&gt;I use tFileInputMail to retrieve an Excel attachment from an email. This is not a problem when the email has been created using Outlook and the Excel file is added as attachment.&lt;BR /&gt;However, when I create the Excel file and send an email from Excel, the attachment is not picked up by Talend.&lt;BR /&gt;It seems that the emails are different.&lt;BR /&gt;When attached in Outlook, the email contains different content types:&lt;BR /&gt;Content-Type: multipart/mixed;&lt;BR /&gt;Content-Type: multipart/alternative;&lt;BR /&gt;Content-Type: text/plain;&lt;BR /&gt;Content-Type: text/html;&lt;BR /&gt;Content-Type: application/vnd.ms-excel;&lt;BR /&gt;When emailed via Excel, the email only contains content type application/vnd.ms-excel&lt;BR /&gt;...and in this case the attachment is not being extracted.&lt;BR /&gt;Anybody has a solution?&lt;BR /&gt;Tnx in advance!</description>
      <pubDate>Sat, 16 Nov 2024 12:32:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Fetching-mail-with-Excel-attachment-fails/m-p/2331993#M100919</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching mail with Excel attachment fails</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Fetching-mail-with-Excel-attachment-fails/m-p/2331994#M100920</link>
      <description>Hey, 
&lt;BR /&gt;when sending data from Excel the content of the file is filled into the message directly, this is indicated from the MIME type. So there is no attachment and therefore Talend cannot pickup anything. I don't know if Excel has some configuration about how to send it. 
&lt;BR /&gt;Of course you could make it done by writing simple VBA module (ALT + F11) and connect it to custom button in Excel GUI. 
&lt;BR /&gt;Following code will save Active workbook, send it in Outlook way (message with attachment): 
&lt;BR /&gt; 
&lt;PRE&gt;Sub Save_and_Mail_workbook_Outlook()&lt;BR /&gt;'Working in 2000-2010&lt;BR /&gt;    Dim wb1 As Workbook&lt;BR /&gt;    Dim wb2 As Workbook&lt;BR /&gt;    Dim TempFilePath As String&lt;BR /&gt;    Dim TempFileName As String&lt;BR /&gt;    Dim FileExtStr As String&lt;BR /&gt;    Dim OutApp As Object&lt;BR /&gt;    Dim OutMail As Object&lt;BR /&gt;    Set wb1 = ActiveWorkbook&lt;BR /&gt;    If Val(Application.Version) &amp;gt;= 12 Then&lt;BR /&gt;        If wb1.FileFormat = 51 And wb1.HasVBProject = True Then&lt;BR /&gt;            MsgBox "There is VBA code in this xlsx file, there will" &amp;amp; vbNewLine &amp;amp; _&lt;BR /&gt;                   "be no VBA code in the file you send. Save the" &amp;amp; vbNewLine &amp;amp; _&lt;BR /&gt;                   "file first as xlsm and then try the macro again.", vbInformation&lt;BR /&gt;            Exit Sub&lt;BR /&gt;        End If&lt;BR /&gt;    End If&lt;BR /&gt;    With Application&lt;BR /&gt;        .ScreenUpdating = False&lt;BR /&gt;        .EnableEvents = False&lt;BR /&gt;    End With&lt;BR /&gt;    'Make a copy of the file/Open it/Mail it/Delete it&lt;BR /&gt;    'If you want to change the file name then change only TempFileName&lt;BR /&gt;    TempFilePath = Environ$("temp") &amp;amp; "\"&lt;BR /&gt;    TempFileName = "Copy of " &amp;amp; wb1.Name &amp;amp; " " &amp;amp; Format(Now, "dd-mmm-yy h-mm-ss")&lt;BR /&gt;    FileExtStr = "." &amp;amp; LCase(Right(wb1.Name, _&lt;BR /&gt;                                   Len(wb1.Name) - InStrRev(wb1.Name, ".", , 1)))&lt;BR /&gt;    wb1.SaveCopyAs TempFilePath &amp;amp; TempFileName &amp;amp; FileExtStr&lt;BR /&gt;    Set wb2 = Workbooks.Open(TempFilePath &amp;amp; TempFileName &amp;amp; FileExtStr)&lt;BR /&gt;    Set OutApp = CreateObject("Outlook.Application")&lt;BR /&gt;    Set OutMail = OutApp.CreateItem(0)&lt;BR /&gt;    On Error Resume Next&lt;BR /&gt;    With OutMail&lt;BR /&gt;        .To = "ron@debruin.nl"&lt;BR /&gt;        .CC = ""&lt;BR /&gt;        .BCC = ""&lt;BR /&gt;        .Subject = "This is the Subject line"&lt;BR /&gt;        .Body = "Hi there"&lt;BR /&gt;        .Attachments.Add wb2.FullName&lt;BR /&gt;        'You can add other files also like this&lt;BR /&gt;        '.Attachments.Add ("C:\test.txt")&lt;BR /&gt;        .Send   'or use .Display&lt;BR /&gt;    End With&lt;BR /&gt;    On Error GoTo 0&lt;BR /&gt;    wb2.Close SaveChanges:=False&lt;BR /&gt;    'Delete the file&lt;BR /&gt;    Kill TempFilePath &amp;amp; TempFileName &amp;amp; FileExtStr&lt;BR /&gt;    Set OutMail = Nothing&lt;BR /&gt;    Set OutApp = Nothing&lt;BR /&gt;    With Application&lt;BR /&gt;        .ScreenUpdating = True&lt;BR /&gt;        .EnableEvents = True&lt;BR /&gt;    End With&lt;BR /&gt;End Sub&lt;/PRE&gt; 
&lt;BR /&gt;Ladislav</description>
      <pubDate>Wed, 30 Nov 2011 19:24:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Fetching-mail-with-Excel-attachment-fails/m-p/2331994#M100920</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-30T19:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching mail with Excel attachment fails</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Fetching-mail-with-Excel-attachment-fails/m-p/2331995#M100921</link>
      <description>Thanks for the explanation and sorry for my late reply, but this will not work in my situation. We receive emails like this from our clients. Is there absolutely no way Talend can extract the attachments? Is there another solution using a custom Java component?</description>
      <pubDate>Mon, 13 Feb 2012 14:28:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Fetching-mail-with-Excel-attachment-fails/m-p/2331995#M100921</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-13T14:28:07Z</dc:date>
    </item>
  </channel>
</rss>

