Search Results

Search found 1018 results on 41 pages for 'attachment'.

Page 10/41 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How to add attachment in RFC822 format MAIL using Google API ?

    - by Pari
    I am trying to add attachment in RFC822 format MAIL using Google API (c#). Referring to this link http://code.google.com/apis/apps/email_migration/developers_guide_dotnet.html How should i start? Can anyone give me sample mail value? Is there any study material or documentation available on net.To understand Google Apps Email Migration API.

    Read the article

  • How do I programmatically send email w/attachment to a known recipient using MAPI in C++? MAPISendM

    - by Tim
    This question is similar, but does not show how to add a recipient. How do I do both? We'd like the widest support possible for as many Windows platforms as possible (from XP and greater) We're using visual studio 2008 Essentially we want to send an email with: pre-filled destination address file attachment subject line from our program and give the user the ability to add any information or cancel it. EDIT I am trying to use MAPISendMail() I copied much of the code from the questions linked near the top, but I get no email dlg box and the error return I get from the call is: 0x000f - "The system cannot find the drive specified" If I comment out the lines to set the recipient, it works fine (of course then I have no recipient pre-filled in) Here is the code: #include <tchar.h> #include <windows.h> #include <mapi.h> #include <mapix.h> int _tmain( int argc, wchar_t *argv[] ) { HMODULE hMapiModule = LoadLibrary( _T( "mapi32.dll" ) ); if ( hMapiModule != NULL ) { LPMAPIINITIALIZE lpfnMAPIInitialize = NULL; LPMAPIUNINITIALIZE lpfnMAPIUninitialize = NULL; LPMAPILOGONEX lpfnMAPILogonEx = NULL; LPMAPISENDDOCUMENTS lpfnMAPISendDocuments = NULL; LPMAPISESSION lplhSession = NULL; LPMAPISENDMAIL lpfnMAPISendMail = NULL; lpfnMAPIInitialize = (LPMAPIINITIALIZE)GetProcAddress( hMapiModule, "MAPIInitialize" ); lpfnMAPIUninitialize = (LPMAPIUNINITIALIZE)GetProcAddress( hMapiModule, "MAPIUninitialize" ); lpfnMAPILogonEx = (LPMAPILOGONEX)GetProcAddress( hMapiModule, "MAPILogonEx" ); lpfnMAPISendDocuments = (LPMAPISENDDOCUMENTS)GetProcAddress( hMapiModule, "MAPISendDocuments" ); lpfnMAPISendMail = (LPMAPISENDMAIL)GetProcAddress( hMapiModule, "MAPISendMail" ); if ( lpfnMAPIInitialize && lpfnMAPIUninitialize && lpfnMAPILogonEx && lpfnMAPISendDocuments ) { HRESULT hr = (*lpfnMAPIInitialize)( NULL ); if ( SUCCEEDED( hr ) ) { hr = (*lpfnMAPILogonEx)( 0, NULL, NULL, MAPI_EXTENDED | MAPI_USE_DEFAULT, &lplhSession ); if ( SUCCEEDED( hr ) ) { // this opens the email client // create the msg. We need to add recipients AND subject AND the dmp file // file attachment MapiFileDesc filedesc; ::ZeroMemory(&filedesc, sizeof(filedesc)); filedesc.nPosition = (ULONG)-1; filedesc.lpszPathName = "E:\\Development\\Open\\testmail\\testmail.cpp"; // recipient(s) MapiRecipDesc recip; ::ZeroMemory(&recip, sizeof(recip)); recip.lpszName = "QA email"; recip.lpszAddress = "[email protected]"; // the message MapiMessage msg; ::ZeroMemory(&msg, sizeof(msg)); msg.lpszSubject = "Test"; msg.nRecipCount = 1; // if I comment out this line it works fine... msg.lpRecips = &recip; msg.nFileCount = 1; msg.lpFiles = &filedesc; hr = (*lpfnMAPISendMail)(0, NULL, &msg, MAPI_LOGON_UI|MAPI_DIALOG, 0); if ( SUCCEEDED( hr ) ) { hr = lplhSession->Logoff( 0, 0, 0 ); hr = lplhSession->Release(); lplhSession = NULL; } } } (*lpfnMAPIUninitialize)(); } FreeLibrary( hMapiModule ); } return 0; }

    Read the article

  • How do I send a file as an email attachment using Linux command line?

    - by Kit Roed
    I've created a script that runs every night on my Linux server that uses mysqldump to back up each of my MySQL databases to .sql files and packages them together as a compressed .tar file. The next step I want to accomplish is to send that tar file through email to a remote email server for safekeeping. I've been able to send the raw script in the body an email by piping the backup text file to mailx like so: $ cat mysqldbbackup.sql | mailx [email protected] cat echoes the backup file's text which is piped into the mailx program with the recipient's email address passed as an argument. While this accomplishes what I need, I think it could be one step better, Is there any way, using shell scripts or otherwise, to send the compressed .tar file to an outgoing email message as an attachment? This would beat having to deal with very long email messages which contain header data and often have word-wrapping issues etc.

    Read the article

  • rails + paperclip: Is a generic "Attachment" model a good idea?

    - by egarcia
    On my application I've several things with attachments on them, using paperclip. Clients have one logo. Stores can have one or more pictures. These pictures, in addition, can have other information such as the date in which they were taken. Products can have one or more pictures of them, categorized (from the font, from the back, etc). For now, each one of my Models has its own "paperclip-fields" (Client has_attached_file) or has_many models that have attached files (Store has_many StorePictures, Product has_many ProductPictures) My client has also told me that in the future we might be adding more attachments to the system (i.e. pdf documents for the clients to download). My application has a rather complex authorization system implemented with declarative_authorization. One can not, for example, download pictures from a product he's not allowed to 'see'. I'm considering re-factoring my code so I can have a generic "Attachment" model. So any model can has_many :attachments. With this context, does it sound like a good idea? Or should I continue making Foos and FooPictures?

    Read the article

  • How do I get Thunderbird to open an ICS attachment directly in Lightning's calendar?

    - by travis
    I'm using Mozilla Thunderbird 9.0.1 with Lightning 1.1.1. Is there an easier way to import an ICS file attached to an email than saving it to disk, then in Calendar going to File -- Open? If I select "Open with Thunderbird" from the save dialog, it just opens a new mail message and attaches the file to it. (I did see this older question, but it refers to much older versions of Thunderbird and Lightning) Update: I've updated to 10.0 and 1.2, respectively and it still doesn't work right. Update 2: Bugzilla.

    Read the article

  • IntentService android download and return file to Activity

    - by Andrew G
    I have a fairly tricky situation that I'm trying to determine the best design for. The basics are this: I'm designing a messaging system with a similar interface to email. When a user clicks a message that has an attachment, an activity is spawned that shows the text of that message along with a paper clip signaling that there is an additional attachment. At this point, I begin preloading the attachment so that when the user clicks on it - it loads more quickly. currently, when the user clicks the attachment, it prompts with a loading dialog until the download is complete at which point it loads a separate attachment viewer activity, passing in the bmp byte array. I don't ever want to save attachments to persistent storage. The difficulty I have is in supporting rotation as well as home button presses etc. The download is currently done with a thread and handler setup. Instead of this, I'd like the flow to be the following: User loads message as before, preloading begins of attachment as before (invisible to user). When the user clicks on the attachment link, the attachment viewer activity is spawned right away. If the download was done, the image is displayed. If not, a dialog is shown in THIS activity until it is done and can be displayed. Note that ideally the download never restarts or else I've wasted cycles on the preload. Obviously I need some persistent background process that is able to keep downloading and is able to call back to arbitrarily bonded Activities. It seems like the IntentService almost fits my needs as it does its work in a background thread and has the Service (non UI) lifecycle. However, will it work for my other needs? I notice that common implementations for what I want to do get a Messenger from the caller Activity so that a Message object can be sent back to a Handler in the caller's thread. This is all well and good but what happens in my case when the caller Activity is Stopped or Destroyed and the currently active Activity (the attachment viewer) is showing? Is there some way to dynamically bind a new Activity to a running IntentService so that I can send a Message back to the new Activity? The other question is on the Message object. Can I send arbitrarily large data back in this package? For instance, rather than send back that "The file was downloaded", I need to send back the byte array of the downloaded file itself since I never want to write it to disk (and yes this needs to be the case). Any advice on achieving the behavior I want is greatly appreciated. I've not been working with Android for that long and I often get confused with how to best handle asynchronous processes over the course of the Activity lifecycle especially when it comes to orientation changes and home button presses...

    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

  • 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

  • How to loop through LI items in UL, get specific attributes, and pass them via $.ajax data

    - by Ahmed Fouad
    Here is my HTML code: <ul id="gallery"> <li id="attachment-32" class="featured"><a href="..." title=""><img src="..." alt="" /></a></li> <li id="attachment-34"><a href="..." title=""><img src="..." alt="" /></a></li> <li id="attachment-38"><a href="..." title=""><img src="..." alt="" /></a></li> <li id="attachment-64"><a href="..." title=""><img src="..." alt="" /></a></li> <li id="attachment-75"><a href="..." title=""><img src="..." alt="" /></a></li> <li></li> </ul> Here is my sample ajax request: $.ajax({ url: '/ajax/upload.php', type: 'POST', data: { ... }, success: function(data){ } }); Here is what I want to achieve. How to get the attachment number in ID attribute for every LI inside the gallery UL only when an ID attr is there and pass them via ajax data in this way: { attached : '32,34,38,64,75' } if there is a better way of doing this let me know I want to pass the list items which contain attachments to process. How to get the list item LI which has class of featured e.g. { featured_img : .. } and pass the attachment ID number if featured LI exists, and if none of list items is featured pass featured_img with 0. So i know how to process it via php in the request. Any help is appreciated. Thank you.

    Read the article

  • Facebook Stream.Get -- How to access data in array?

    - by user316841
    On stream.get, I try to echo $feeds["posts"][$i]["attachment"]["href"]; It return the URL, but, in the same array scope where "type" is located (which returns string: video, etc), trying $feeds["posts"][$i]["attachment"]["type"] returns nothing at all! Here's an array through PHP's var_dump: http://pastie.org/930475 So, from testing I suppose this is protected by Facebook? Does that makes sense at all? Here it's full: http://pastie.org/930490, but not all attachment/media/types has values. It's also strange, because I can't access through [attachment][media][href] or [attachment][media][type], and if I try [attachment][media][0][type] or href, it gives me a string offset error. ["attachment"]=> array(8) { ["media"]=> array(1) { [0]=> array(5) { ["href"]=> string(55) "http://www.facebook.com/video/video.php?v=1392999461587" ["alt"]=> string(13) "IN THE STUDIO" ["type"]=> string(5) "video" My question is, is this protected by Facebook? Or we can actually access this array position?

    Read the article

  • Problem with NSString

    - by Kassar
    I have a problem with NSString in dynamic binding ... I manipulate with Facebook library, when i'll share my story i should make an instance of FBStreamDialog and charge its attributes with values of the story then show it, like this: FBStreamDialog* dialog = [[[FBStreamDialog alloc] init]autorelease]; dialog.delegate = self; dialog.userMessagePrompt = @"prompt"; NSString* sss=@"{ \"name\":\"%@\", \"href\":\"%@\", \"caption\":\"%@\", \"description\":\"%@\" , \"media\":[{ \"type\":\"image\", \"src\":\"%@\", \"href\":\"%@\" }] }"; dialog.attachment = [NSString stringWithFormat:sss,@"title",@"http://www.docs.com/hi.html",@"caption",@"summary",@"http://www.images.com/206.jpg",@"http://www.images.com/206.jpg"]; NSLog(@"ATTACHMENT: %@",dialog.attachment); The code above is running well. But my problem is when i want to charge these attributes dynamically like this: BStreamDialog* dialog = [[[FBStreamDialog alloc] init]autorelease]; dialog.delegate = self; dialog.userMessagePrompt = @"prompt"; NSString* sss=@"{ \"name\":\"%@\", \"href\":\"%@\", \"caption\":\"%@\", \"description\":\"%@\" , \"media\":[{ \"type\":\"image\", \"src\":\"%@\", \"href\":\"%@\" }] }"; dialog.attachment = [NSString stringWithFormat:sss,story.title,story.link,story.caption,story.summary,story.imagelink,story.imagelink]; NSLog(@"ATTACHMENT: %@",dialog.attachment); It's running without crash but it doesn't share the story it share a blank one !!! Although, it shows in the console (output of NSLog) the value of attachment is true !!! Could you plz help me. Sorry for my english.

    Read the article

  • How to use perl for SMTP connection with user and SSL Auth and send emails with attachment

    - by Octopus
    I am using a SMTP mail server which require user + ssl authentication for connection. I am looking for the perl modules to connect to the mail server and send emails but doesn't found anything helpful. Any suggestion for perl module or any perl code would be really appreciated. EDIT I have tried to use Mail::Sendmail and Net::SMTP::SSL to connect to the sendmail server and send mail. Below is the sample code but getting the error user unknown. Error: mail: Net::SMTP::SSL=GLOB(0x9599850) not found RCPT TO: error (550 5.1.1 <[email protected]>... User unknown). Code: #!/usr/bin/perl use strict; use warnings; use Mail::Sendmail; use Net::SMTP::SSL; my %mail = ( #To=> 'No to field this time, only Bcc and Cc', From=> '[email protected]', Cc=> '[email protected]', # Cc will appear in the header. (Bcc will not) Subject => 'Test message', 'X-Mailer' => "Mail::Sendmail version $Mail::Sendmail::VERSION", ); $mail{Smtp} = Net::SMTP::SSL->new("mail.server.com", Port=> 465); $mail{auth} = {user=>'username', password=>"password", required=>1 }; $mail{'X-custom'} = 'My custom additionnal header'; $mail{Message} = "The message key looks terrible, but works."; # cheat on the date: $mail{Date} = Mail::Sendmail::time_to_date( time() - 86400 ); if (sendmail %mail) { print "Mail sent OK.\n" } else { print "Error sending mail: $Mail::Sendmail::error \n" } print "\n\$Mail::Sendmail::log says:\n", $Mail::Sendmail::log;

    Read the article

  • How do I turn a PDF email attachment to an image (jpg) in a PHP page?

    - by user351630
    Hi guys. Long time viewer, first time question asker. I'm trying to have my personal website parse through my mail box for attachments from a certain subscription list, and then be able to view the PDF attachments as images, preferably jpg. With the help of this: http://www.linuxscope.net/articles/mailAttachmentsPHP.html I'm currently using imap_base64() to decode the MIME data and create the PDF. However, I hate using PDF readers in general and I thought it would be a lot more streamlined if I could just view it as an image instead. I've heard for convert with ImageMagick, but would I need to actually write the PDF to a directory before using this, or can I convert somehow directly from the MIME data in the email? Thanks in advanced!

    Read the article

  • KeepAliveException when using HttpWebRequest.GetResponse

    - by Lucas
    I am trying to POST an attachment to CouchDB using the HttpWebRequest. However, when I attempt "response = (HttpWebResponse)httpWebRequest.GetResponse();" I receive a WebException with the message "The underlying connection was closed: A connection that was expected to be kept alive was closed by the server." I have found some articles stating that setting the keepalive to false and httpversion to 1.0 resolves the situation. I am finding that it does not yeilding the exact same error, plus I do not want to take that approach as I do not want to use the 1.0 version due to how it handles the connection. Any suggestions or ideas are welcome. I'll try them all until one works! public ServerResponse PostAttachment(Server server, Database db, Attachment attachment) { Stream dataStream; HttpWebResponse response = null; StreamReader sr = null; byte[] buffer; string json; string boundary = "----------------------------" + DateTime.Now.Ticks.ToString("x"); string headerTemplate = "Content-Disposition: form-data; name=\"_attachments\"; filename=\"" + attachment.Filename + "\"\r\n Content-Type: application/octet-stream\r\n\r\n"; byte[] headerbytes = System.Text.Encoding.UTF8.GetBytes(headerTemplate); byte[] boundarybytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n"); HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create("http://" + server.Host + ":" + server.Port.ToString() + "/" + db.Name + "/" + attachment.Document.Id); httpWebRequest.ContentType = "multipart/form-data; boundary=" + boundary; httpWebRequest.Method = "POST"; httpWebRequest.KeepAlive = true; httpWebRequest.ContentLength = attachment.Stream.Length + headerbytes.Length + boundarybytes.Length; if (!string.IsNullOrEmpty(server.EncodedCredentials)) httpWebRequest.Headers.Add("Authorization", server.EncodedCredentials); if (!attachment.Stream.CanRead) throw new System.NotSupportedException("The stream cannot be read."); // Get the request stream try { dataStream = httpWebRequest.GetRequestStream(); } catch (Exception e) { throw new WebException("Failed to get the request stream.", e); } buffer = new byte[server.BufferSize]; int bytesRead; dataStream.Write(headerbytes,0,headerbytes.Length); attachment.Stream.Position = 0; while ((bytesRead = attachment.Stream.Read(buffer, 0, buffer.Length)) > 0) { dataStream.Write(buffer, 0, bytesRead); } dataStream.Write(boundarybytes, 0, boundarybytes.Length); dataStream.Close(); // send the request and get the response try { response = (HttpWebResponse)httpWebRequest.GetResponse(); } catch (Exception e) { throw new WebException("Invalid response received from server.", e); } // get the server's response json try { dataStream = response.GetResponseStream(); sr = new StreamReader(dataStream); json = sr.ReadToEnd(); } catch (Exception e) { throw new WebException("Failed to access the response stream.", e); } // close up all our streams and response sr.Close(); dataStream.Close(); response.Close(); // Deserialize the server response return ConvertTo.JsonToServerResponse(json); }

    Read the article

  • Unable to send smtp emails in C# with a VMware vm of win 7

    - by Egon
    the VMware is able to ping the gmail server. sample code MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com"); mail.From = new MailAddress("[email protected]"); mail.To.Add("to"); mail.Subject = "subjct"; mail.Body = "email body!!"; System.Net.Mail.Attachment attachment; attachment = new System.Net.Mail.Attachment("filename.extension"); mail.Attachments.Add(attachment); SmtpServer.Port = 587; SmtpServer.Credentials = new System.Net.NetworkCredential("email id", "password"); SmtpServer.EnableSsl = true; SmtpServer.Send(mail); I have got it has something to do with ports being open on vmware some networking issue, but i just can't put a finger on it. Please let know what it is that i am doing wrong. Thnx - Egon

    Read the article

  • Method not being resolved for dynamic generic type

    - by kelloti
    I have these types: public class GenericDao<T> { public T Save(T t) { return t; } } public abstract class DomainObject { // Some properties protected abstract dynamic Dao { get; } public virtual void Save() { var dao = Dao; dao.Save(this); } } public class Attachment : DomainObject { protected dynamic Dao { get { return new GenericDao<Attachment>(); } } } Then when I run this code it fails with RuntimeBinderException: Best overloaded method match for 'GenericDAO<Attachment.Save(Attachment)' has some invalid arguments var obj = new Attachment() { /* set properties */ }; obj.Save(); I've verified that in DomainObject.Save() "this" is definitely Attachment, so the error doesn't really make sense. Can anyone shed some light on why the method isn't resolving? Some more information - It succeeds if I change the contents of DomainObject.Save() to use reflection: public virtual void Save() { var dao = Dao; var type = dao.GetType(); var save = ((Type)type).GetMethod("Save"); save.Invoke(dao, new []{this}); }

    Read the article

  • WebCenter Customer Spotlight: College of American Pathologists

    - by me
    Author: Peter Reiser - Social Business Evangelist, Oracle WebCenter  Solution Summary College of American Pathologists Goes Live with OracleWebCenter - Imaging, AP Invoice Automation, and EBS Managed Attachment with Support for Imaging ContentThe College of American Pathologists (CAP), the leading organization of board-certified pathologists serving more then 18,000 physician members, 7,000 laboratories are accredited by the CAP, and approximately 22,000 laboratories are enrolled in the College’s proficiency testing programs. The business objective was to content-enable their Oracle E-Business Suite (EBS) enterprise application by combining the best of Imaging and Manage Attachment functionality providing a unique opportunity for the business to have unprecedented access to both structure and unstructured content from within their enterprise application. The solution improves customer services turnaround time, provides better compliance and improves maintenance and management of the technology infrastructure. Company OverviewThe College of American Pathologists (CAP), celebrating 50 years as the gold standard in laboratory accreditation, is a medical society serving more than 17,000 physician members and the global laboratory community. It is the world’s largest association composed exclusively of board certified pathologists and is the worldwide leader in laboratory quality assurance. The College advocates accountable, high-quality, and cost-effective patient care. The more than 17,000 pathologist members of the College of American Pathologists represent board-certified pathologists and pathologists in training worldwide. More than 7,000 laboratories are accredited by the CAP, and approximately 23,000 laboratories are enrolled in the College’s proficiency testing programs.  Business ChallengesThe CAP business objective was to content-enable their Oracle E-Business Suite (EBS) enterprise application by combining the best of Imaging and Manage Attachment functionality providing a unique opportunity for the business to have unprecedented access to both structure and unstructured content from within their enterprise application.  Bring more flexibility to systems and programs in order to adapt quickly Get a 360 degree view of the customer Reduce cost of running the business Solution DeployedWith the help of Oracle Consulting, the customer implemented Oracle WebCenter Content as the centralized E-Business Suite Document Repository.  The solution enables to capture, present and manage all unstructured content (PDFs,word processing documents, scanned images, etc.) related to Oracle E-Business Suite transactions and exposing the related content using the familiar EBS User Interface. Business ResultsThe CAP achieved following benefits from the implemented solution: Managed Attachment Solution Align with strategic Oracle Fusion Middleware platform Integrate with the CAP existing data capture capabilities Single user interface provided by the Managed Attachment solution for all content Better compliance and improved collaboration  Account Payables Invoice Processing Imaging Solution Automated invoice management eliminating dependency on paper materials and improving compliance, collaboration and accuracy A single repository to house and secure scanned invoices and all supplemental documents Greater management visibility of invoice entry process Additional Information CAP OpenWorld Presentation Oracle WebCenter Content Oracle Webcenter Capture Oracle WebCenter Imaging Oracle  Consulting

    Read the article

  • Can MFMailComposeViewController attach an XML doc to an HTML message?

    - by Luther Baker
    I am creating an email in MFMaiilComposeViewController and if I simply create some html snippets and assign them to the message body - all is well. The resulting email (in GMail and Yahoo) looks like the original HTML I sent. [mailMan_ setMessageBody:body isHTML:YES]; On the other hand, if I also include an XML attachment, my email reader renders everything as plain text … including, the XML inlined. IE: my mail client (GMail, Yahoo) shows the raw HTHML and XML tags - including html tags that I didn't supply - ie: the html, head, body tags the iPhone provides around the content: NSData *opmlData = [[NSData alloc] initWithData:[opml dataUsingEncoding:NSUTF8StringEncoding]]; NSString *fileName = [NSString stringWithFormat:@"%f.opml", [NSDate timeIntervalSinceReferenceDate]]; [mailMan_ addAttachmentData:opmlData mimeType:@"text/xml" fileName:fileName]; I pop3'd the mails to see what was happening and found that WITHOUT an attachment, the resulting html section of the email contains this block: --0-1682099714-1273329398=:59784 Content-Type: text/html; charset=us-ascii <html><body bgcolor="#FFFFFF"><div><h2 style="b while on the other hand, WITH the XML attachment, the iPhone is sending this: --0-881105825-1273328091=:50337 Content-Type: text/plain; charset=us-ascii <html><body bgcolor="#FFFFFF"><div><h2 style="bac Notice the difference? Look at the Content-Type … text/html vs text/plain. It looks like when I include an XML attachment, the iPhone is errantly tagging the HTML version of the body as plain text! Just to clarify, technically, both with and without the attachment, the iPhone also includes this: --0-881105825-1273328091=:50337 Content-Type: text/plain; charset=us-ascii Notebook Carpentry Bathroom floor tile Bathroom wall tile Scrape thinset But this obviously isn't where the problem lies. Am I doing something wrong? What must I do to actually "attach" XML without the iPhone labeling the entire HTML body as plain text. I tried reversing the assignments (attachment first and then body) but no luck. For what it's worth, the email looks perfect from the iPhone's sending interface. Indeed, the HTML renders correctly and the attachment looks like a little icon at the bottom of the message. This problem has more to do with what the iPhone is actually sending.

    Read the article

  • some PDF's to iPhones via ActiveSync are corrupt

    - by longneck
    we have two server applications (one .NET/ASP web app, the other a native Windows app) that generate PDF's that are then emailed to our users on Exchange 2010. the apps deliver the emails to the Exchange server via SMTP, and our iPhone/iPad users receive their email via activesync. pretty much all of the PDF's generated by the web app and many of the PDF's generated by the Windows app fail to open on an iPhone or iPad. tapping the attachment shows the screen that would display the PDF with the name of the file at the top but the bottom of the screen is completely grey. one thing i have figured out is that the attachment on the iPad is uuencoded. forwarding the attachment to another email address shows the uuencoded format. here's a sample: begin 600 unknown M)5!$1BTQ+C0-)>+CS],-"C8@,"!O8FH\/"](6S8U-B`Q-#A=+TQI;F5A<FEZ M960@,2]%(#DQ-#8O3"`Q,S`Q.2].(#$O3R`Y+U0@,3(X-3,^/@UE;F1O8FH- ---snip--- M,C8T,"`P,#`P,"!N#0IT<F%I;&5R#0H\/"]3:7IE(#8^/@T*<W1A<G1X<F5F .#0HQ,38-"B4E14]&#0H` ` end whereas the normal version of the file looks like a normal PDF: %PDF-1.4 %âãÏÓ 6 0 obj<</H[656 147]/Linearized 1/E 9698/L 13571/N 1/O 9/T 13405>> ---snip--- trailer <</Size 6>> startxref 116 %%EOF so i think the problem is that the attachment is being double uuencoded somewhere, or the iPhone is failing to recognize that the attachment is uuencoded and not decoding it. any suggestions on where to begin troubleshooting this problem?

    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

  • Save Word document to clipboard

    - by uwe
    I often come into the following situation: Get an email with attachment in MS Outlook Open that attachment in MS Word Starting to edit the document in MS Word Start replying to the email in MS Outlook Getting the edited document into my reply I have to save that file to disk and then drag it as attachment. I would think of a short way to get that document as attachement in the newly generated email. Is there a way to implement a save location as clipboard or just a copy to clipboard (the document, not the content)?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >