Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

Sending array of files as attachements to email address without Mail Interface

S_ernoS_erno Posts: 37Registered Users
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?
Post edited by S_erno on

Replies

  • baja_yubaja_yu Posts: 6,166Super Moderators, Registered Users
    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.
  • S_ernoS_erno Posts: 37Registered Users
    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_ernoS_erno Posts: 37Registered Users
    Ive made some small progress with this, could anyone tell me if the following code is correct:
    On a button press:

    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:

    for (int i=0;[someArray count];i++)
    {
    [composer addAttachement:[NSData dataWithContentsOfFile:[array objectAtIndex:i]] mimeType:@\"xml/text\" fileName:[NSString stringWithFormat:@\"%@.xml\",[nameArray objectAtIndex:i]];
    }

Sign In or Register to comment.