Search Results

Search found 565 results on 23 pages for 'attachments'.

Page 1/23 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Undocumented Gmail Search Operator Ferrets Out Large Email Attachments

    - by Jason Fitzpatrick
    If you’re looking for a way to quickly find large email attachments in your Gmail account, this undocumented search operator makes it simple to zero in on the hulking attachments hiding out in your inbox. To use the search operator simply plug in “size:” and some value to narrow your search to only emails that size or larger. In the screenshot above we searched for “size:20000000″ to search for files roughly 20MB or larger (if you want to be extremely precise, a true 20MB search would be “size:20971520″). If you’re looking to clean up your Gmail account this is a nearly zero-effort way to find the biggest space hogs–in our case, we found an email packed with massive PDF files from a 5 year old project that we were more than happy to purge. Finding Large Attachments in Google Mail/Gmail [via gHacks] 6 Ways Windows 8 Is More Secure Than Windows 7 HTG Explains: Why It’s Good That Your Computer’s RAM Is Full 10 Awesome Improvements For Desktop Users in Windows 8

    Read the article

  • Handling HumanTask attachments in Oracle BPM 11g PS4FP+ (I)

    - by ccasares
    Adding attachments to a HumanTask is a feature that exists in Oracle HWF (Human Workflow) since 10g. However, in 11g there have been many improvements on this feature and this entry will try to summarize them. Oracle BPM 11g 11.1.1.5.1 (aka PS4 Feature Pack or PS4FP) introduced two great features: Ability to link attachments at a Task scope or at a Process scope: "Task" attachments are only visible within the scope (lifetime) of a task. This means that, initially, any member of the assignment pattern of the Human Task will be able to handle (add, review or remove) attachments. However, once the task is completed, subsequent human tasks will not have access to them. This does not mean those attachments got lost. Once the human task is completed, attachments can be retrieved in order to, i.e., check them in to a Content Server or to inject them to a new and different human task. Aside note: a "re-initiated" human task will inherit comments and attachments, along with history and -optionally- payload. See here for more info. "Process" attachments are visible within the scope of the process. This means that subsequent human tasks in the same process instance will have access to them. Ability to use Oracle WebCenter Content (previously known as "Oracle UCM") as the backend for the attachments instead of using HWF database backend. This feature adds all content server document lifecycle capabilities to HWF attachments (versioning, RBAC, metadata management, etc). As of today, only Oracle WCC is supported. However, Oracle BPM Suite does include a license of Oracle WCC for the solely usage of document management within BPM scope. Here are some code samples that leverage the above features. Retrieving uploaded attachments -Non UCM- Non UCM attachments (default ones or those that have existed from 10g, and are stored "as-is" in HWK database backend) can be retrieved after the completion of the Human Task. Firstly, we need to know whether any attachment has been effectively uploaded to the human task. There are two ways to find it out: Through an XPath function: Checking the execData/attachment[] structure. For example: Once we are sure one ore more attachments were uploaded to the Human Task, we want to get them. In this example, by "get" I mean to get the attachment name and the payload of the file. Aside note: Oracle HWF lets you to upload two kind of [non-UCM] attachments: a desktop document and a Web URL. This example focuses just on the desktop document one. In order to "retrieve" an uploaded Web URL, you can get it directly from the execData/attachment[] structure. Attachment content (payload) is retrieved through the getTaskAttachmentContents() XPath function: This example shows how to retrieve as many attachments as those had been uploaded to the Human Task and write them to the server using the File Adapter service. The sample process excerpt is as follows:  A dummy UserTask using "HumanTask1" Human Task followed by a Embedded Subprocess that will retrieve the attachments (we're assuming at least one attachment is uploaded): and once retrieved, we will write each of them back to a file in the server using a File Adapter service: In detail: We've defined an XSD structure that will hold the attachments (both name and payload): Then, we can create a BusinessObject based on such element (attachmentCollection) and create a variable (named attachmentBPM) of such BusinessObject type. We will also need to keep a copy of the HumanTask output's execData structure. Therefore we need to create a variable of type TaskExecutionData... ...and copy the HumanTask output execData to it: Now we get into the embedded subprocess that will retrieve the attachments' payload. First, and using an XSLT transformation, we feed the attachmentBPM variable with the name of each attachment and setting an empty value to the payload: Please note that we're using the XSLT for-each node to create as many target structures as necessary. Also note that we're setting an Empty text to the payload variable. The reason for this is to make sure the <payload></payload> tag gets created. This is needed when we map the payload to the XML variable later. Aside note: We are assuming that we're retrieving non-UCM attachments. However in real life you might want to check the type of attachment you're handling. The execData/attachment[]/storageType contains the values "UCM" for UCM type attachments, "TASK" for non-UCM ones or "URL" for Web URL ones. Those values are part of the "Ext.Com.Oracle.Xmlns.Bpel.Workflow.Task.StorageTypeEnum" enumeration. Once we have fed the attachmentsBPM structure and so it now contains the name of each of the attachments, it is time to iterate through it and get the payload. Therefore we will use a new embedded subprocess of type MultiInstance, that will iterate over the attachmentsBPM/attachment[] element: In every iteration we will use a Script activity to map the corresponding payload element with the result of the XPath function getTaskAttachmentContents(). Please, note how the target array element is indexed with the loopCounter predefined variable, so that we make sure we're feeding the right element during the array iteration:  The XPath function used looks as follows: hwf:getTaskAttachmentContents(bpmn:getDataObject('UserTask1LocalExecData')/ns1:systemAttributes/ns1:taskId, bpmn:getDataObject('attachmentsBPM')/ns:attachment[bpmn:getActivityInstanceAttribute('SUBPROCESS3067107484296', 'loopCounter')]/ns:fileName)  where the input parameters are: taskId of the just completed Human Task attachment name we're retrieving the payload from array index (loopCounter predefined variable)  Aside note: The reason whereby we're iterating the execData/attachment[] structure through embedded subprocess and not, i.e., using XSLT and for-each nodes, is mostly because the getTaskAttachmentContents() XPath function is currently not available in XSLT mappings. So all this example might be considered as a workaround until this gets fixed/enhanced in future releases. Once this embedded subprocess ends, we will have all attachments (name + payload) in the attachmentsBPM variable, which is the main goal of this sample. But in order to test everything runs fine, we finish the sample writing each attachment to a file. To that end we include a final embedded subprocess to concurrently iterate through each attachmentsBPM/attachment[] element: On each iteration we will use a Service activity that invokes a File Adapter write service. In here we have two important parameters to set. First, the payload itself. The file adapter awaits binary data in base64 format (string). We have to map it using XPath (Simple mapping doesn't recognize a String as a base64-binary valid target):  Second, we must set the target filename using the Service Properties dialog box:  Again, note how we're making use of the loopCounter index variable to get the right element within the embedded subprocess iteration. Handling UCM attachments will be part of a different and upcoming blog entry. Once I finish will all posts on this matter, I will upload the whole sample project to java.net.

    Read the article

  • Outlook 2007 + Exchange 2010 (Save All Attachments)

    - by RobertPitt
    About 3 weeks back our company upgraded our mail system to Exchange 2010, all went smooth, few issues but nothing major. A few days ago we had a call from a colleague where he was unable to save all attachments, From File > Save As > Save All Attachments. When the email has a single attachment it works perfectly normal, and depending on the file type it allows you to save multiple attachments. But there's a lot of file types that will not work, such as zip, pdf, doc etc, Usually we get a location box open up asking where we would like to drop the attachments, but it does nothing, You click Save All Attachments and nothing happens. After hours of research I have come across mixed results, a lot of people on forums have been explaining that they have recently crossed over to Exchange 2010 and there issues started there. But on the other hand Microsoft released a KB (278188) which was depressing if that, but that article was published in 2007, as stated by the time stamp, and Exchange 2010 has only come out recently. Im looking to see if you guys have any clues what could be causing this, anything server side that I can take a look at (AD, Exchange, ...). Any help on this is greatly supported

    Read the article

  • Outlook receives winmail.txt attachment instead of Excel, PowerPoint or Word attachments from Lotus notes senders

    - by Philippe
    Ok so the title pretty much says it all. We are offering a Hosted Exchange solution for our customer. Everything is working fine except for one customer complaining that he is receiving winmail.dat or winmail.txt attachments instead of the actual Word Excel or PowerPoint attachments he should be receiving, only when these messages come from a specific European senders, that is using Lotus Notes. I know that usually the problem is coming from Outlook senders to other mail clients, but this is not the first they inform me of this but I can't find anything on the matter so far. Has anyone ever gotten and solved this problem? If not, does anyone have any idea regarding this? I had solved this problem a few months ago, by upgrading Outlook to SP2 and then uninstalling it using the Service Pack removing tool of Microsoft. It seems that only the latest SP1 version could work but not the SP2. The problem is that now nothing is working at all. Thank you for your help, Philippe

    Read the article

  • Can't see attachments in OWA but can in Outlook

    - by johnny
    Hi, I have several users, including myself, that cannot see attached images (.jpg) in OWA. I can see them in Outlook but in OWA the attachments, the link to see them, are not included. I see the line for attachments in the message. But it's just empty. I have other messages that have been sent to me from outside of the domain and I can see them. Just not internally sent ones. Was hoping for help. Thank you. I did not see anything in the file levels of the registry to prohibit .jpg files. Exchange 2003 Server, Outlook 2003, OWA for 2003.

    Read the article

  • Outlook receives winmail.txt attachment instead of Excel, PowerPoint or Word attachments from Lotus

    - by Philippe
    Ok so the title pretty much says it all. We are offering a Hosted Exchange solution for our customer. Everything is working fine except for one customer complaining that he is receiving winmail.dat or winmail.txt attachments instead of the actual Word Excel or PowerPoint attachments he should be receiving, only when these messages come from a specific European senders, that is using Lotus Notes. I know that usually the problem is coming from Outlook senders to other mail clients, but this is not the first they inform me of this but I can't find anything on the matter so far. Has anyone ever gotten and solved this problem? If not, does anyone have any idea regarding this? I had solved this problem a few months ago, by upgrading Outlook to SP2 and then uninstalling it using the Service Pack removing tool of Microsoft. It seems that only the latest SP1 version could work but not the SP2. The problem is that now nothing is working at all. Thank you for your help, Philippe

    Read the article

  • Downloading attachments to directory with IMAP in PHP, randomly works

    - by Nick
    I found PHP code online to download attachments to a directory using IMAP from here. http://www.nerdydork.com/download-pop3imap-email-attachments-with-php.html I modified it slightly changing $structure = imap_fetchstructure($mbox, $jk); $parts = ($structure->parts); to $structure = imap_fetchstructure($mbox, $jk); $parts = ($structure); to get it to run properly, as otherwise I got an error about how stdClass doesn't define a property called $parts. Doing that, I was able to download all the attachments. I tested it again recently though, and it didn't work. Well, it didn't work 6 times, worked the 7th, and then hasn't worked since. I'm thinking it has something to do with me screwing up the parts handling, since count($parts) keeps returning 1 for each message, so it's not finding any attachments I think. Since it downloaded the attachments at one point with no issues, I feel confident that the area things are getting screwed up is right here. Before this block of code is a for loop that goes through each message in the box, and after it is loop that just goes through $parts for each imap structure. Thanks for any help you can provide. I looked at the imap_fetchstructure page on php.net and can't figure out what I'm doing wrong. Edit: I just double-checked the folder after typing up my question and it all popped up. I feel like I'm going nuts. I hadn't run the code since a few minutes before I started typing this, and it doesn't make sense to me that it would take this long to trigger. I have some 800 messages in the mailbox, but I figured since it printed my statement at the very end of the PHP that all of the file creation work was done.

    Read the article

  • Redirect anything within /attachments/ directory up one level but also removing anything after /attachments/

    - by Rich Staats
    WordPress creates an attachment page for any images uploaded through the post editor and "attached" to that post. After migrating a site, those attachment pages no longer exist, and we now have around 1000 links pointed at 404's. So, I was looking to find a way to do a redirect for any url that has /attachement/ in it's string and then push that url back up one level (which happens to be the post page). so for instance: http://mysite.com/2012/news/blog-post-title/attachment/image-page/ (which doesnt exist) will go to http://mysite.com/2012/news/blog-post-title/ (which does exist). Along with redirecting up one level, I also need to remove anything after /attachment/ (in this case the "image-page." Any suggestions? Thanks in advance

    Read the article

  • Sharepoint NewForm adding attachments programatically

    - by CodeSpeaker
    I have a list with a custom form which contains a custom file upload control. As soon as the user selects a file and clicks upload, i want this file to go directly to the attachments list within that listitem. However, when adding the file to SPContext.Current.ListItem.Attachments on a new item, the attachment wont show up in the list after saving. If i instead use item.Update() on the new item after adding the attachment i get an error in Sharepoint, but when i then go back to the list, the item is there with its attachment. It seems like its trying to create 2 new entries at once when i save (item.Update) which results in the second of those crashing. What would be the correct way to add attachments this way? oSPWeb.AllowUnsafeUpdates = true; // Get the List item SPListItem listItem = SPContext.Current.ListItem; // Get the Attachment collection SPAttachmentCollection attachmentCollection = listItem.Attachments; Stream attachmentStream; Byte[] attachmentContent; // Get the file from the file upload control if (fileUpload.HasFile) { attachmentStream = fileUpload.PostedFile.InputStream; attachmentContent = new Byte[attachmentStream.Length]; attachmentStream.Read(attachmentContent, 0, (int)attachmentStream.Length); attachmentStream.Close(); attachmentStream.Dispose(); // Add the file to the attachment collection attachmentCollection.Add(fileUpload.FileName, attachmentContent); } // Update th list item listItem.Update();

    Read the article

  • Sending email with attachments from C#, attachments arrive as Part 1.2 in Thunderbird

    - by Jon
    I have a C# application which emails out Excel spreadsheet reports via an Exchange 2007 server using SMTP. These arrive fine for Outlook users, but for Thunderbird and Blackberry users the attachments have been renamed as "Part 1.2". I found this article which describes the problem, but doesn't seem to give me a workaround. I don't have control of the Exchange server so can't make changes there. Is there anything I can do on the C# end? I have tried using short filenames and HTML encoding for the body but neither made a difference. My mail sending code is simply this: public static void SendMail(string recipient, string subject, string body, string attachmentFilename) { SmtpClient smtpClient = new SmtpClient(); NetworkCredential basicCredential = new NetworkCredential(MailConst.Username, MailConst.Password); MailMessage message = new MailMessage(); MailAddress fromAddress = new MailAddress(MailConst.Username); // setup up the host, increase the timeout to 5 minutes smtpClient.Host = MailConst.SmtpServer; smtpClient.UseDefaultCredentials = false; smtpClient.Credentials = basicCredential; smtpClient.Timeout = (60 * 5 * 1000); message.From = fromAddress; message.Subject = subject; message.IsBodyHtml = false; message.Body = body; message.To.Add(recipient); if (attachmentFilename != null) message.Attachments.Add(new Attachment(attachmentFilename)); smtpClient.Send(message); } Thanks for any help.

    Read the article

  • Problem with displaying and downloading email attachments using the zend framework

    - by Ali
    Hi guys I'm trying to display emails in my inbox and their respective attachments. At the same time I also wish to be able to download the attachments however I'm kinda stuck here. Here is the code I use to display the attachments: $one_message = $mail->getMessage($i); $one_message->id = $i; $one_message->UID = $mail->getUniqueId($i); // get the contact of this message $email = array_pop(extract_emails_from($one_message->from)); $one_message->contactFrom = $contact_manager->get_person_from_email($email); $one_message->parts = array(); foreach (new RecursiveIteratorIterator($mail->getMessage($i)) as $ii=>$part) { try { $tpart = $part; $one_message->parts[$ii] = $tpart; // put the part of the message indexed with what I assume is its position if (strtok($part->contentType, ';') == 'text/html') { $b = $part->getContent(); $h2t->set_html($b); $one_message->body = $h2t->get_text(); } if (strtok($part->contentType, ';') == 'text/plain') { $b = $part->getContent(); $one_message->body = $part->getContent(); } } catch (Zend_Mail_Exception $e) { // ignore } } And I display the attachments using the following link: ?action=download&element=email-attachment&box=inbox&uid=<?php echo $one_message->UID;?>&id=<?php echo $one_message->id;?>&part=<?php echo $ii;?> The part variable is the index taken from the loop above However when I try to download using the exact same code as above modified slightly: $id = $_GET['id']; $pid = $_GET['part']; $one_message = $mail->getMessage($id); foreach (new RecursiveIteratorIterator($mail->getMessage($id)) as $ii=>$part) { if($pid == $ii): $content = base64_decode($part->getContent()); $cnt_typ = explode(";" , $part->contentType); $name = explode("=",$cnt_typ[1]); $filename = $name[1];//It is the file name of the attachement in browser //This for avoiding " from the file name when sent from yahoomail $filename = str_replace('"'," ",$filename); $filename = trim($filename); header("Cache-Control: public"); header("Content-Type: ".$cn_typ[1]); header("Content-Disposition: attachment; filename=\"" . $filename . "\""); header("Content-Transfer-Encoding: binary"); echo $content; exit; endif; } For some reason it doesn't work at all. I did a var dump and noticed that in the for loop with the reverseiterator teh indexes $ii returned are 1 - 2 - 2 !! Whats going on here how can the indexes be repeated? How can I tell one part from the others?

    Read the article

  • Outlook sends uninvited images as attachments

    - by serhio
    Outlook is always sending along 2 pictures (image001.png and image002.gif) with my mails. Even if I don't attach any images. How do I fix this? Thanks. EDIT - SIGNATURE The HTML of my signature: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML xmlns:o = "urn:schemas-microsoft-com:office:office"><HEAD><TITLE>Company default Signature</TITLE> <META content="text/html; charset=windows-1252" http-equiv=Content-Type> <META name=GENERATOR content="MSHTML 8.00.6001.18854"></HEAD> <BODY> <DIV align=left><FONT color=navy size=2 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: navy; FONT-SIZE: 10pt"> <P class=MsoNormal align=left><BR>Cordialement,&nbsp;</SPAN></FONT><FONT color=navy size=2 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: navy; FONT-SIZE: 10pt"><o:p>&nbsp;</o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy size=2 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: navy; FONT-SIZE: 10pt">Firstname LASTNAME<BR></SPAN></FONT><FONT color=navy size=2 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: navy; FONT-SIZE: 10pt">COMPANY Name<o:p></o:p></SPAN></FONT></P></DIV></BODY></HTML> EDIT 2 - STATIONERY I don't use stationery format: EDIT 3 - HTML If I delete the signature (Ctrl+A, Del) in the HTML mode the images always appear. If I use the signature in text only mode, the images disappears...

    Read the article

  • Outlook sends uninvited images as attachments

    - by serhio
    Outlook is always sending along 2 pictures (image001.png and image002.gif) with my mails. Even if I don't attach any images. How do I fix this? Thanks. EDIT - SIGNATURE The HTML of my signature: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML xmlns:o = "urn:schemas-microsoft-com:office:office"><HEAD><TITLE>Company default Signature</TITLE> <META content="text/html; charset=windows-1252" http-equiv=Content-Type> <META name=GENERATOR content="MSHTML 8.00.6001.18854"></HEAD> <BODY> <DIV align=left><FONT color=navy size=2 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: navy; FONT-SIZE: 10pt"> <P class=MsoNormal align=left><BR>Cordialement,&nbsp;</SPAN></FONT><FONT color=navy size=2 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: navy; FONT-SIZE: 10pt"><o:p>&nbsp;</o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy size=2 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: navy; FONT-SIZE: 10pt">Firstname LASTNAME<BR></SPAN></FONT><FONT color=navy size=2 face=Arial><SPAN style="FONT-FAMILY: Arial; COLOR: navy; FONT-SIZE: 10pt">COMPANY Name<o:p></o:p></SPAN></FONT></P></DIV></BODY></HTML> EDIT 2 - STATIONERY I don't use stationery format: EDIT 3 - HTML If I delete the signature (Ctrl+A, Del) in the HTML mode the images always appear. If I use the signature in text only mode, the images disappears...

    Read the article

  • Is there any way to search within OneNote 2007 attachments

    - by jtolle
    I'm starting to use OneNote (2007) more. One thing I'd like to do is take notes on papers I have read. That is, I attach, say, a PDF file, and then type in some notes about it. Sometimes I do other stuff like copy some key text or figures from the paper, so OneNote is great for this because all that plus my own notes plus the file itself can all be in one place. However, the OneNote search doesn't seem to be able to search within said PDF files. Windows search finds things, but just in the OneNote cache, not the actual Onenote .one files. (Presumably that will only work for recently accessed stuff, and in any case doesn't take me to my actual notes.) Is there a way to do what I want? If not, does anyone have a suggestion (or link) as to how to best use OneNote to store (and later search for!) this kind of content and notes?

    Read the article

  • Outlook 2007 attachments wont preview

    - by Slace
    When I get an email with an attachment in Outlook 2007 that I should be able to preview (ie - image, word doc, etc) I get the following error: This file cannot be previewed because of an error in the following previewer: Microsoft Outlook image previewer To open this file in its own program double-click it. (obviously the previewer changes name depending on the type) The computer is a clean install (it's only 5 days old) and I remember I was at one point able to preview within Outlook. I'd really like this feature to be back working, I've tried the usual exit Outlook, restart Windows, etc but to no avail.

    Read the article

  • Corrupted attachments in Thunderbird forward filter

    - by Guandalino
    I created a filter in Thunderbird 14 on client A that, when a certain rule on incoming mail is satisfied, the same mail is forwarded to client B and C. Matching mails received from A are always forwarded to B and C, and that's what I want. Though, when the mail on A has an attachment, it is also forwarded by B and C but the file they receive is corrupted. In my case the incoming file on A is a Word file of about 10kb in size; clients B and C receive a Word file of 27 bytes. I think this could happen because the forward starts from A when the attachment is not yet completely downloaded. I'm not sure this is the cause, though. And I wouldn't have any idea for a fix. Any idea about how to investigate or solve the issue?

    Read the article

  • Where does Outlook 2007 store opened attachments temporarily?

    - by pelms
    If a 'friend' has double-clicked an Excel attachment from an Outlook 2007 email and worked on it, saved it and then closed Excel and the email, where would that file be lurking (assuming I haven't exited Outlook? I seem to remember Outlook 2003 putting stuff in %username%\Local Setings\Temporary Internet Files in OLK prefixed folders, but no sign of anything relevant looking in there. I'm he's on Windows XP. Update Temporary folder eventually found in: C:\Documents and Settings\username\Local Settings\Temporary Internet Files\Content.Outlook but need to navigate directly to this folder via pasting into 'Run...' dialog or Explorer to see it. Unfortunately, Outlook deletes the attchment when you close the email.

    Read the article

  • Preventing Thunderbird to add .txt to attachments on open

    - by Horcrux7
    How can I prevent Thunderbird to add the extension .txt to a file when open the attachment. I have the problem with .patch files which I want look with notepad++. The problem is that notepad++ does not detect the right formating for the file because the extension is .txt. If I drag the file on the desktop an double click all is working. Why change Thunderbird the file name on opening? I am working on Windows 7.

    Read the article

  • SmtpClient and Locked File Attachments

    - by Rick Strahl
    Got a note a couple of days ago from a client using one of my generic routines that wraps SmtpClient. Apparently whenever a file has been attached to a message and emailed with SmtpClient the file remains locked after the message has been sent. Oddly this particular issue hasn’t cropped up before for me although these routines are in use in a number of applications I’ve built. The wrapper I use was built mainly to backfit an old pre-.NET 2.0 email client I built using Sockets to avoid the CDO nightmares of the .NET 1.x mail client. The current class retained the same class interface but now internally uses SmtpClient which holds a flat property interface that makes it less verbose to send off email messages. File attachments in this interface are handled by providing a comma delimited list for files in an Attachments string property which is then collected along with the other flat property settings and eventually passed on to SmtpClient in the form of a MailMessage structure. The jist of the code is something like this: /// <summary> /// Fully self contained mail sending method. Sends an email message by connecting /// and disconnecting from the email server. /// </summary> /// <returns>true or false</returns> public bool SendMail() { if (!this.Connect()) return false; try { // Create and configure the message MailMessage msg = this.GetMessage(); smtp.Send(msg); this.OnSendComplete(this); } catch (Exception ex) { string msg = ex.Message; if (ex.InnerException != null) msg = ex.InnerException.Message; this.SetError(msg); this.OnSendError(this); return false; } finally { // close connection and clear out headers // SmtpClient instance nulled out this.Close(); } return true; } /// <summary> /// Configures the message interface /// </summary> /// <param name="msg"></param> protected virtual MailMessage GetMessage() { MailMessage msg = new MailMessage(); msg.Body = this.Message; msg.Subject = this.Subject; msg.From = new MailAddress(this.SenderEmail, this.SenderName); if (!string.IsNullOrEmpty(this.ReplyTo)) msg.ReplyTo = new MailAddress(this.ReplyTo); // Send all the different recipients this.AssignMailAddresses(msg.To, this.Recipient); this.AssignMailAddresses(msg.CC, this.CC); this.AssignMailAddresses(msg.Bcc, this.BCC); if (!string.IsNullOrEmpty(this.Attachments)) { string[] files = this.Attachments.Split(new char[2] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries); foreach (string file in files) { msg.Attachments.Add(new Attachment(file)); } } if (this.ContentType.StartsWith("text/html")) msg.IsBodyHtml = true; else msg.IsBodyHtml = false; msg.BodyEncoding = this.Encoding; … additional code omitted return msg; } Basically this code collects all the property settings of the wrapper object and applies them to the SmtpClient and in GetMessage() to an individual MailMessage properties. Specifically notice that attachment filenames are converted from a comma-delimited string to filenames from which new attachments are created. The code as it’s written however, will cause the problem with file attachments not being released properly. Internally .NET opens up stream handles and reads the files from disk to dump them into the email send stream. The attachments are always sent correctly but the local files are not immediately closed. As you probably guessed the issue is simply that some resources are not automatcially disposed when sending is complete and sure enough the following code change fixes the problem: // Create and configure the message using (MailMessage msg = this.GetMessage()) { smtp.Send(msg); if (this.SendComplete != null) this.OnSendComplete(this); // or use an explicit msg.Dispose() here } The Message object requires an explicit call to Dispose() (or a using() block as I have here) to force the attachment files to get closed. I think this is rather odd behavior for this scenario however. The code I use passes in filenames and my expectation of an API that accepts file names is that it uses the files by opening and streaming them and then closing them when done. Why keep the streams open and require an explicit .Dispose() by the calling code which is bound to lead to unexpected behavior just as my customer ran into? Any API level code should clean up as much as possible and this is clearly not happening here resulting in unexpected behavior. Apparently lots of other folks have run into this before as I found based on a few Twitter comments on this topic. Odd to me too is that SmtpClient() doesn’t implement IDisposable – it’s only the MailMessage (and Attachments) that implement it and require it to clean up for left over resources like open file handles. This means that you couldn’t even use a using() statement around the SmtpClient code to resolve this – instead you’d have to wrap it around the message object which again is rather unexpected. Well, chalk that one up to another small unexpected behavior that wasted a half an hour of my time – hopefully this post will help someone avoid this same half an hour of hunting and searching. Resources: Full code to SmptClientNative (West Wind Web Toolkit Repository) SmtpClient Documentation MSDN © Rick Strahl, West Wind Technologies, 2005-2010Posted in .NET  

    Read the article

  • Did OpenPOP.net with GMail attachments break recently?

    - by Ashley Simpson
    I could swear this code was working few days ago. I'm using the SSL binaries from http://trixy.justinkbeck.com/2009/07/c-pop3-library-with-ssl-for-gmail.html POPClient client = new POPClient("pop.gmail.com", 995, "[email protected]", "qwerty", AuthenticationMethod.USERPASS, true); int unread = client.GetMessageCount(); for (int i = 0; i < unread; i++) { Message m = client.GetMessage(i + 1, true); Console.WriteLine(m.Subject); if (m.HasAttachment) { Attachment a = m.GetAttachment(1); // Problem! HasAttachment flag is set, but there's no attachments in the collection! m.SaveAttachment(a, a.ContentFileName); } } client.QUIT(); But today, I can read the mail ok but the attachments are empty. I'm thinking the China fiasco caused them to change something. Ideas?

    Read the article

  • Handling HumanTask attachments in Oracle BPM 11g PS4FP+ (II)

    - by ccasares
    Retrieving uploaded attachments -UCM- As stated in my previous blog entry, Oracle BPM 11g 11.1.1.5.1 (aka PS4FP) introduced a new cool feature whereby you can use Oracle WebCenter Content (previously known as Oracle UCM) as the repository for the human task attached documents. For more information about how to use or enable this feature, have a look here. The attachment scope (either TASK or PROCESS) also applies to UCM-attachments. But even with this other feature, one question might arise when using UCM attachments. How can I get them from within the process? The first answer would be to use the same getTaskAttachmentContents() XPath function already explained in my previous blog entry. In fact, that's the way it should be. But in Oracle BPM 11g 11.1.1.5.1 (PS4FP) and 11.1.1.6.0 (PS5) there's a bug that prevents you to do that. If you invoke such function against a UCM-attachment, you'll get a null content response (bug#13907552). Even if the attachment was correctly uploaded. While this bug gets fixed, next I will show a workaround that lets me to retrieve the UCM-attached documents from within a BPM process. Besides, the sample will show how to interact with WCC API from within a BPM process.Aside note: I suggest you to read my previous blog entry about Human Task attachments where I briefly describe some concepts that are used next, such as the execData/attachment[] structure. Sample Process I will be using the following sample process: A dummy UserTask using "HumanTask2" Human Task, followed by an Embedded Subprocess that will retrieve the attachments payload. In this case, and here's the key point of the sample, we will retrieve such payload using WebCenter Content WebService API (IDC): and once retrieved, we will write each of them back to a file in the server using a File Adapter service: In detail:  We will use the same attachmentCollection XSD structure and same BusinessObject definition as in the previous blog entry. However we create a separate variable, named attachmentUCM, based on such BusinessObject. We will still need to keep a copy of the HumanTask output's execData structure. Therefore we need to create a new variable of type TaskExecutionData (different one than the other used for non-UCM attachments): As in the non-UCM attachments flow, in the output tab of the UserTask mapping, we'll keep a copy of the execData structure: Now we get into the embedded subprocess that will retrieve the attachments' payload. First, and using an XSLT transformation, we feed the attachmentUCM variable with the following information: The name of each attachment (from execData/attachment/name element) The WebCenter Content ID of the uploaded attachment. This info is stored in execData/attachment/URI element with the format ecm://<id>. As we just want the numeric <id>, we need to get rid of the protocol prefix ("ecm://"). We do so with some XPath functions as detailed below: with these two functions being invoked, respectively: We, again, set the target payload element with an empty string, to get the <payload></payload> tag created. The complete XSLT transformation is shown below. Remember that we're using the XSLT for-each node to create as many target structures as necessary.  Once we have fed the attachmentsUCM structure and so it now contains the name of each of the attachments along with each WCC unique id (dID), it is time to iterate through it and get the payload. Therefore we will use a new embedded subprocess of type MultiInstance, that will iterate over the attachmentsUCM/attachment[] element: In each iteration we will use a Service activity that invokes WCC API through a WebService. Follow these steps to create and configure the Partner Link needed: Login to WCC console with an administrator user (i.e. weblogic). Go to Administration menu and click on "Soap Wsdls" link. We will use the GetFile service to retrieve a file based on its dID. Thus we'll need such service WSDL definition that can be downloaded by clicking the GetFile link. Save the WSDL file in your JDev project folder. In the BPM project's composite view, drag & drop a WebService adapter to create a new External Reference, based on the just added GetFile.wsdl. Name it UCM_GetFile. WCC services are secured through basic HTTP authentication. Therefore we need to enable the just created reference for that: Right-click the reference and click on Configure WS Policies. Under the Security section, click "+" to add the "oracle/wss_username_token_client_policy" policy The last step is to set the credentials for the security policy. For the sample we will use the admin user for WCC (weblogic/welcome1). Open the composite.xml file and select the Source view. Search for the UCM_GetFile entry and add the following highlighted elements into it:   <reference name="UCM_GetFile" ui:wsdlLocation="GetFile.wsdl">     <interface.wsdl interface="http://www.stellent.com/GetFile/#wsdl.interface(GetFileSoap)"/>     <binding.ws port="http://www.stellent.com/GetFile/#wsdl.endpoint(GetFile/GetFileSoap)"                 location="GetFile.wsdl" soapVersion="1.1">       <wsp:PolicyReference URI="oracle/wss_username_token_client_policy"                            orawsp:category="security" orawsp:status="enabled"/>       <property name="weblogic.wsee.wsat.transaction.flowOption"                 type="xs:string" many="false">WSDLDriven</property>       <property name="oracle.webservices.auth.username"                 type="xs:string">weblogic</property>       <property name="oracle.webservices.auth.password"                 type="xs:string">welcome1</property>     </binding.ws>   </reference> Now the new external reference is ready: Once the reference has just been created, we should be able now to use it from our BPM process. However we find here a problem. The WCC GetFile service operation that we will use, GetFileByID, accepts as input a structure similar to this one, where all element tags are optional: <get:GetFileByID xmlns:get="http://www.stellent.com/GetFile/">    <get:dID>?</get:dID>   <get:rendition>?</get:rendition>   <get:extraProps>      <get:property>         <get:name>?</get:name>         <get:value>?</get:value>      </get:property>   </get:extraProps></get:GetFileByID> and we need to fill up just the <get:dID> tag element. Due to some kind of restriction or bug on WCC, the rest of the tag elements must NOT be sent, not even empty (i.e.: <get:rendition></get:rendition> or <get:rendition/>). A sample request that performs the query just by the dID, must be in the following format: <get:GetFileByID xmlns:get="http://www.stellent.com/GetFile/">   <get:dID>12345</get:dID></get:GetFileByID> The issue here is that the simple mapping in BPM does create empty tags being a sample result as follows: <get:GetFileByID xmlns:get="http://www.stellent.com/GetFile/"> <get:dID>12345</get:dID> <get:rendition/> <get:extraProps/> </get:GetFileByID> Although the above structure is perfectly valid, it is not accepted by WCC. Therefore, we need to bypass the problem. The workaround we use (many others are available) is to add a Mediator component between the BPM process and the Service that simply copies the input structure from BPM but getting rid of the empty tags. Follow these steps to configure the Mediator: Drag & drop a new Mediator component into the composite. Uncheck the creation of the SOAP bindings and use the Interface Definition from WSDL template and select the existing GetFile.wsdl Double click in the mediator to edit it. Add a static routing rule to the GetFileByID operation, of type Service and select References/UCM_GetFile/GetFileByID target service: Create the request and reply XSLT mappers: Make sure you map only the dID element in the request: And do an Auto-mapper for the whole response: Finally, we can now add and configure the Service activity in the BPM process. Drag & drop it to the embedded subprocess and select the NormalizedGetFile service and getFileByID operation: Map both the input: ...and the output: Once this embedded subprocess ends, we will have all attachments (name + payload) in the attachmentsUCM variable, which is the main goal of this sample. But in order to test everything runs fine, we finish the sample writing each attachment to a file. To that end we include a final embedded subprocess to concurrently iterate through each attachmentsUCM/attachment[] element: On each iteration we will use a Service activity that invokes a File Adapter write service. In here we have two important parameters to set. First, the payload itself. The file adapter awaits binary data in base64 format (string). We have to map it using XPath (Simple mapping doesn't recognize a String as a base64-binary valid target): Second, we must set the target filename using the Service Properties dialog box: Again, note how we're making use of the loopCounter index variable to get the right element within the embedded subprocess iteration. Final blog entry about attachments will handle how to inject documents to Human Tasks from the BPM process and how to share attachments between different User Tasks. Will come soon. Again, once I finish will all posts on this matter, I will upload the whole sample project to java.net.

    Read the article

  • Gmail Now Searches Inside PDF, Word, and PowerPoint Attachments

    - by Jason Fitzpatrick
    Gmail has long had a robust system for searching within the subjects and bodies of your emails, now you can search inside select attachments–PDF, Word, and PowerPoint attachments are all searchable. Prior to this update, Gmail could search inside of HTML attachments but lacked more advanced attachment querying abilities. Now when you search your Gmail account you’ll see search results for not only the subject and body contents but also the contents of popular formats like PDF and Word documents. Don’t forget to take advantage of advanced search terms to speed up your query. If you know the information you need is in an attachment but can’t remember which email, include “has:attachment” in your search to only peek inside emails with attachments. [via GadgetBox] HTG Explains: How Antivirus Software Works HTG Explains: Why Deleted Files Can Be Recovered and How You Can Prevent It HTG Explains: What Are the Sys Rq, Scroll Lock, and Pause/Break Keys on My Keyboard?

    Read the article

  • Saving multiple attachments in phpmyadmin [closed]

    - by Madiha
    I am sending multiple attachments with an Email message. I am saving the Email message and Email Address in database (i.e., phpmyadmin). Now i want to save the multiple attachments data i.e., Contents of file, Extension, Size and name of file , How can i do it. I am getting the size of file now by the following code in javascript: var size = this.files[0].size; I am a new in php, so any easy tutorials, and help you can specify.. Also i want all the Attachments (maximum 5) to be saved in one cell (i.e., FileContents) in database, same the extensions and sizes collective of all attachments in one cell (i.e., Extensions). Please any body to help

    Read the article

  • Save GMail attachments directly to Google Drive

    - by Gopinath
    What makes Google Drive attractive is it ability to play nice with other Google offerings like Google Docs, GMail, Android mobiles & tablets. Google Drive is well integrated with Google Docs and every document you create is automatically saved on Google Drive. Google Drive’s integration with other services like GMail may be in progress at Google, but enthusiastic community developers has released a plugin to integrate with GMail. The Google Chrome plugin “Gmail Attachments To Drive” lets you automatically save GMail attachments to Google Drive with a single click. Once the plugin is installed it adds a link “Save To Drive” next to each attachment displayed on GMail and on clicking, it automatically saves the files to Google Drive. I tested the plugin by saving attachments like PDFs, MS Word documents and Images to Google Drive and it worked very well.  I don’t have any complaints on the plugin except couple of feature requests. If the plugin can provide option “Save All Files To Drive” it will be very much helpful to save all attachment of an email at one shot. Also it would be great if the developer can extend it to Firefox too. Anyways it’s a great plugin for Google Drive users and worth checking it out. Install Gmail Attachments To Drive for Google Chrome

    Read the article

  • Send Multiple InMemory Attachments Using FileUpload Controls

    - by bullpit
    I wanted to give users an ability to send multiple attachments from the web application. I did not want anything fancy, just a few FileUpload controls on the page and then send the email. So I dropped five FileUpload controls on the web page and created a function to send email with multiple attachments. Here’s the code: public static void SendMail(string fromAddress, string toAddress, string subject, string body, HttpFileCollection fileCollection)     {         // CREATE THE MailMessage OBJECT         MailMessage mail = new MailMessage();           // SET ADDRESSES         mail.From = new MailAddress(fromAddress);         mail.To.Add(toAddress);           // SET CONTENT         mail.Subject = subject;         mail.Body = body;         mail.IsBodyHtml = false;                        // ATTACH FILES FROM HttpFileCollection         for (int i = 0; i < fileCollection.Count; i++)         {             HttpPostedFile file = fileCollection[i];             if (file.ContentLength > 0)             {                 Attachment attachment = new Attachment(file.InputStream, Path.GetFileName(file.FileName));                 mail.Attachments.Add(attachment);             }         }           // SEND MESSAGE         SmtpClient smtp = new SmtpClient("127.0.0.1");         smtp.Send(mail);     } And here’s how you call the method: protected void uxSendMail_Click(object sender, EventArgs e)     {         HttpFileCollection fileCollection = Request.Files;         string fromAddress = "[email protected]";         string toAddress = "[email protected]";         string subject = "Multiple Mail Attachment Test";         string body = "Mail Attachments Included";         HelperClass.SendMail(fromAddress, toAddress, subject, body, fileCollection);            }

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >