Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. .controller('General', function($scope){
  2. $scope.EnvioMail= function() {
  3. $scope.contactos=[{correo:"Mail1@gmail.com"},{correo:"mail2@gmail.com"},{correo:"mail3@gmail.com"},{correo:"mail4@gmail.com"}];
  4. for(var i=0; i<$scope.contactos.length;i++){
  5. alert($scope.contactos[i].correo);
  6. }
  7. $scope.nombre="ejemplo@gmail.com";
  8. if(window.plugins && window.plugins.emailComposer) {
  9. window.plugins.emailComposer.showEmailComposerWithCallback(function(result) {
  10. alert("Response ->");
  11. },
  12. "Esta es una prueba para enviar mails desde tu aplicacion ionic", // Subject
  13. "", // Body
  14. [$scope.nombre], // To EN ESTA PARTE QUIERO ENVIARLE A $scope.contactos[i].correo
  15. null, // CC
  16. null, // BCC
  17. false, // isHTML
  18. null, // Attachments
  19. null); // Attachment Data
  20. }
  21. }
  22. })
  23.  
  24. <ion-content ng-controller='General'>
  25. <br><br>
  26. <button class="button button-assertive" ng-click="EnvioMail()">enviar mail</button>
  27. </ion-content>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement