Search code examples
iphoneobjective-cxcodeemail-attachmentsflurry

Is it possible to Add Attachments to my Mail App?


I want to add attachments to my Mail App Is it possible? I am sending mails and receiving mails in my Application but i dont know how to send attachments through mail. please give me a solution for this

Thanks,
Anand

I am Exchanging the messages using with Furry SDK And Webservices, But i need to send Attachments. Or How to send Bytes to Webservices?

In Webservice if we pass string we are using "@"

What we use when we pass Binary Data to Webservice?

In My App Soap for Data is

NSString *soapMsg = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?>\
                     <soap12:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap12=\"http://www.w3.org/2003/05/soap-envelope\">\
                     <soap12:Body>\
                     <InsertAttachmentint xmlns=\"http://tempuri.org/\">\
                     <Filename>string</Filename>\
                     <FileType>string</FileType>\
                     <FileContentint>base64Binary</FileContentint>\
                     </InsertAttachmentint>\
                     </soap12:Body>\
                     </soap12:Envelope>"];

In the above soap We use "%@" in the Place of String, What about base64Binary?


Solution

  • Try this
    NSString *str_html = @"Content of file";
    NSString *filenameForSub = [NSString stringWithFormat:@"%@_Fr.cvs",str_date];
        NSData *myData = [str_html dataUsingEncoding:NSUTF8StringEncoding]; 
    
        [mailController addAttachmentData:myData mimeType:@"text/cvs" fileName:filenameForSub];
        [mailController setMessageBody:filenameForSub isHTML:YES];
    

    go to this link

    http://iphonesdksnippets.com/post/2009/04/30/Send-file-%28images%29-to-web-server-using-POST-method.aspx