Objective C: Send email without leaving app

Yes. Use the MFMailComposeViewController. // From within your active view controller if([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *mailCont = [[MFMailComposeViewController alloc] init]; mailCont.mailComposeDelegate = self; [mailCont setSubject:@”yo!”]; [mailCont setToRecipients:[NSArray arrayWithObject:@”[email protected]”]]; [mailCont setMessageBody:@”Don’t ever want to give you up” isHTML:NO]; [self presentViewController:mailCont animated:YES completion:nil]; } // Then implement the delegate method – (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { [self dismissViewControllerAnimated:YES … Read more

Email validation using regular expression in PHP

Use this instead of a regular expression: if(filter_var($email, FILTER_VALIDATE_EMAIL)) { //Valid email! } Using regular expressions to validate email addresses is not recommended as it is certainly not pretty, especially if you don’t want to exclude somebody who has a valid email address that is correct according to RFC 822 grammar. http://www.php.net/filter_var is your best … Read more

How to validate email id in angularJs using ng-pattern

If you want to validate email then use input with type=”email” instead of type=”text”. AngularJS has email validation out of the box, so no need to use ng-pattern for this. Here is the example from original documentation: <script> function Ctrl($scope) { $scope.text=”[email protected]”; } </script> <form name=”myForm” ng-controller=”Ctrl”> Email: <input type=”email” name=”input” ng-model=”text” required> <br/> <span … Read more