Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-29-2011, 05:53 AM   #1 (permalink)
Registered Member
 
Join Date: Nov 2009
Location: Hungary,Budapest
Posts: 32
S_erno is on a distinguished road
Default Sending array of files as attachements to email address without Mail Interface

HI.
I would like to ask two things. Is it possible to create an array containing certain saved files in the documents directory and then how can this array be sent to an email address?
Is it possible to send this message from a hard coded address to another hard coded mail address without showing the email interface?
S_erno is offline   Reply With Quote
Old 06-29-2011, 06:51 AM   #2 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

It's possible but you need to have your own SMTP server to forward the email, and do all the coding to communicate with it from the app.
baja_yu is offline   Reply With Quote
Old 06-29-2011, 07:29 AM   #3 (permalink)
Registered Member
 
Join Date: Nov 2009
Location: Hungary,Budapest
Posts: 32
S_erno is on a distinguished road
Default

Thank you. I tried to find anything useful concerning this but no luck yet,are there any examples on how to do this somewhere?

With the array I so far managed to save the path name of each file into it, but I'm having problems with how I could send this array as an attachment. Its trivial thats its somekind of a for cycle just cant figure out what to do with it.
S_erno is offline   Reply With Quote
Old 06-30-2011, 08:59 AM   #4 (permalink)
Registered Member
 
Join Date: Nov 2009
Location: Hungary,Budapest
Posts: 32
S_erno is on a distinguished road
Default

Ive made some small progress with this, could anyone tell me if the following code is correct:
On a button press:
Code:
NSString *filepath = <myfilepath goes here>;
[someArray addObject:filepath];
[nameArray addObject:someTextField.text];  //name of the files
And then in MFMailComposeViewController after allocating it and such:
Code:
for (int i=0;[someArray count];i++)
{
[composer addAttachement:[NSData dataWithContentsOfFile:[array objectAtIndex:i]] mimeType:@"xml/text" fileName:[NSString stringWithFormat:@"%@.xml",[nameArray objectAtIndex:i]];
}

Last edited by S_erno; 06-30-2011 at 09:12 AM.
S_erno is offline   Reply With Quote
Reply

Bookmarks

Tags
array, files, mailcomposer

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 334
7 members and 327 guests
chemistry, iOS.Lover, lendo, leostc, Leslie80, pbart, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:30 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0