by OtterSoftware » 25 May 2010, 16:06
Hi Erik and apologies for the long delay in replying.
You can see a more complete example of this in the attachment I added to my other post at http://www.mulle-kybernetik.com/forum/viewtopic.php?f=5&t=59&p=101#p79 but the relevant code is:
NSString *attachmentPath = [[NSBundle mainBundle] pathForResource:@"textfile" ofType:@"txt"];
NSData *attachmentData = [NSData dataWithContentsOfFile:attachmentPath];
NSArray *attachments = [NSArray arrayWithObject:[EDObjectPair pairWithObjects:attachmentData:[attachmentPath lastPathComponent]]];
In Apple's Mail application the contents of the text file is simply inserted into the body of the message and I think that Google Mail shows the same thing as does my mail provider's webmail interface but that at least shows that there is an attachment (although you can't see it once you read the message.
The relevant headers from the email are:
Content-Type: multipart/mixed; boundary=EDMessagePart-12747952670
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0 (EDMessage Framework v1.1)
The (chopped) raw source is:
Content-Type: multipart/mixed; boundary=EDMessagePart-12747952670
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0 (EDMessage Framework v1.1)
This is a MIME encoded message.
--EDMessagePart-12747952670
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
An example message body
--EDMessagePart-12747952670
Content-Type: text/plain; name=textfile.txt
Content-Transfer-Encoding: base64
VGhpcyBpcyBhbiBleGFtcGxlIHRleHQgZmlsZS4=
--EDMessagePart-12747952670--
Hi Erik and apologies for the long delay in replying.
You can see a more complete example of this in the attachment I added to my other post at http://www.mulle-kybernetik.com/forum/viewtopic.php?f=5&t=59&p=101#p79 but the relevant code is:
NSString *attachmentPath = [[NSBundle mainBundle] pathForResource:@"textfile" ofType:@"txt"];
NSData *attachmentData = [NSData dataWithContentsOfFile:attachmentPath];
NSArray *attachments = [NSArray arrayWithObject:[EDObjectPair pairWithObjects:attachmentData:[attachmentPath lastPathComponent]]];
In Apple's Mail application the contents of the text file is simply inserted into the body of the message and I think that Google Mail shows the same thing as does my mail provider's webmail interface but that at least shows that there is an attachment (although you can't see it once you read the message.
The relevant headers from the email are:
Content-Type: multipart/mixed; boundary=EDMessagePart-12747952670
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0 (EDMessage Framework v1.1)
The (chopped) raw source is:
Content-Type: multipart/mixed; boundary=EDMessagePart-12747952670
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0 (EDMessage Framework v1.1)
This is a MIME encoded message.
--EDMessagePart-12747952670
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
An example message body
--EDMessagePart-12747952670
Content-Type: text/plain; name=textfile.txt
Content-Transfer-Encoding: base64
VGhpcyBpcyBhbiBleGFtcGxlIHRleHQgZmlsZS4=
--EDMessagePart-12747952670--