I've developed an application using EDMessage Frameworks which sends
emails with attached PDF to a OSX fax server (running 4-Sight FAX v
7.x). The fax server converts the attached PDF into a 1-bit tiff and
sends it to a fax number specified in the body of the email.
This email w/attachment works very well with all sorts of email
systems, however the fax server 4-Sight FAX v 7.x rejects the
EDMessage email saying it's not formatted properly. After examining
the raw headers of a successful email->fax to 4-Sight FAX vs. an
unsuccessful email->fax which EDMessage created, I have the following
question.
I suspect my Content-Type needs to be specified as Content-Type:
application/pdf rather than Content-Type: application/octet-stream;
What methods/techniques are available in NSData to set Mime-Types and
other such things? Below is example of code I'm using with EDMessage.
NSString *text = @"Kevin Muldoon;Company;1-267-363-7401\r##\rMy fax
cover letter!\r##\r";
NSData *documentData =[NSData dataWithContentsOfFile:@"/Users/kevin/
Documents/example.pdf"];
NSMutableArray *attachmentList = [NSMutableArray array];
[attachmentList addObject:[EDObjectPair
pairWithObjects:documentData:@"example.pdf"]];
NSMutableDictionary * headerFields = [NSMutableDictionary dictionary];
[headerFields setObject:@"Kevin Muldoon <[email protected]>"
forKey:EDMailFrom];
[headerFields setObject:@"Center4Sight <[email protected]>"
forKey:EDMailTo];
[headerFields setObject:@"Hi there, with attachment..."
forKey:EDMailSubject];
EDMailAgent *mailAgent = [EDMailAgent
mailAgentForRelayHostWithName:@"mail.centerforsight.net" port:1234];
[mailAgent setUsesSecureConnections:NO];
[mailAgent sendMailWithHeaders:headerFields body:[text
stringWithCanonicalLinebreaks] andAttachments:attachmentList];
And here is the raw result of that email which fails...
--EDMessagePart-13136997390
Content-Type: text/plain;
charset=US-ASCII;
format=flowed
Content-Transfer-Encoding: 7bit
Kevin Muldoon;Company;1-267-363-7401
##
My fax cover letter!
##
--EDMessagePart-13136997390
Content-Type: application/octet-stream;
name=waitforit.pdf
Content-Transfer-Encoding: base64
Kevin Muldoon
e: [email protected]
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]