Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8028309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:06:02+00:00 2026-06-05T00:06:02+00:00

i am making an email application,where user can set his time to send email?

  • 0

i am making an email application,where user can set his time to send email?
I am able to send an email in a background process at the user selected time,but only when the application is on,with the help of UILocalNotification.
but i want to send the email when user have closed the appliaction.
For example:user have selected time for the mail to be send after 10 min and have closed his app before that.

please help me out

following is my code:

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{

    NSLog(@"didReceiveLocalNotification");

    NSLog(@"\nNotification dic = %@ %@",notification.userInfo,notification.alertBody);

    dictUser=notification.userInfo;
    [dictUser retain];

    NSLog(@"dictuser124:%@",dictUser);
    [dictUser retain];

    if ([str_info4 isEqualToString:@"0"]) 
    {
        [self sendEMAIL];
    }
    else if ([str_info4 isEqualToString:@"1"]) 
    {
        [self sendSMS];
    }

}

-(void)sendEMAIL
{
    [dictUser retain];

    SKPSMTPMessage *testMsg = [[SKPSMTPMessage alloc] init];


    //testMsg.fromEmail = @"Lexi mobile";//nimit51parekh@gmail.com

    testMsg.fromEmail = str_uname;
    NSLog(@"str_Uname=%@",testMsg.fromEmail);

    str_info = [str_info stringByReplacingOccurrencesOfString:@"," withString:@""];
    testMsg.toEmail = str_info;
    NSLog(@"autoemail=%@",testMsg.toEmail);


    testMsg.relayHost = @"smtp.gmail.com";


    testMsg.requiresAuth = YES;


    testMsg.login = str_uname;
    NSLog(@"autoelogin=%@",testMsg.login);

    testMsg.pass = str_password;
    NSLog(@"autopass=%@",testMsg.pass);

    testMsg.subject = @"Schedule Sms And Email";


    testMsg.wantsSecure = YES; 

    NSString *sendmsg=[[NSString alloc]initWithFormat:@"%@",str_info2];
    NSLog(@"automsg=%@",sendmsg);

    testMsg.delegate = self;


    NSDictionary *plainPart = [NSDictionary dictionaryWithObjectsAndKeys:@"text/plain",kSKPSMTPPartContentTypeKey,

                             sendmsg,kSKPSMTPPartMessageKey,@"8bit",kSKPSMTPPartContentTransferEncodingKey,nil];

    testMsg.parts = [NSArray arrayWithObjects:plainPart,nil];


    [testMsg send];

   // [self DeleteRowAfterSending];
    [self performSelector:@selector(DeleteRowAfterSending) withObject:nil afterDelay:5.0];
}



-(void)messageSent:(SKPSMTPMessage *)message

{
    [message release];

    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Success" message:@"Your email is sent successfully" delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];

    [alert show];

    [alert release];

    NSLog(@"delegate - message sent");

}

-(void)messageFailed:(SKPSMTPMessage *)message error:(NSError *)error{

    [message release];

    // open an alert with just an OK button

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Fail" message:@"Message sending failure" delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];

    [alert show];

    [alert release];


    NSLog(@"delegate - error(%d): %@", [error code], [error localizedDescription]);

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T00:06:04+00:00Added an answer on June 5, 2026 at 12:06 am

    As per my knowledge I know this that its kind of not possible to execute something when application is closed and there will be no instance of the application available.

    I would rather suggest the implementation of push notifications in the same using the SERVER at backend. You can save the time in database during which the user has to send the email and accordingly write the CRONS for sending the email at that moment of time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making an application where I want to send an email using smtp
I am making a email sending application in android phone. For that I included
I am making an application which takes image from the camera and then email
If I was making a message application (e.g. email), and I had to count
im making an android application which requires a user to register using a form
I am making an application in which I am taking some information from user
I m using jsf2.0. And i m making one email application, I m calling
I am making a small change to an existing application so that users can
I have some sort of evaluating application in the making, it's almost finished but
I am making an email application which is giving the error in this question's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.