ios - How to get mail configuration information if allowed? -
hi using smtp server framework send mails.
nsarray *arr1 = [testmsg.fromemail componentsseparatedbystring:@"@"]; nsarray *arr2 = [[arr1 objectatindex:1] componentsseparatedbystring:@"."]; if ([arr2 containsobject:@"gmail"]) { testmsg.relayhost = @"smtp.gmail.com"; } else if ([arr2 containsobject:@"yahoo"]) { testmsg.relayhost = @"smtp.mail.yahoo.com"; } else if ([arr2 containsobject:@"hotmail"] || [arr2 containsobject:@"live"]) { testmsg.relayhost = @"smtp.live.com"; } else { nsstring *smtprelay = [[nsstring alloc]init]; smtprelay = [nsstring stringwithformat:@"smtp.%@.com",[arr2 objectatindex:0]]; testmsg.relayhost = smtprelay; } testmsg.requiresauth = yes; testmsg.login = @"mycompanyusername@mycompany.com"; testmsg.password = @"********"; testmsg.subject = @"this email subject line"; testmsg.wantssecure = yes; // smtp.gmail.com doesn't work without tls!
if want send mail office id or other want fetch mail info automatically configured in mail application.
so can send mail configured mail (in device).is possible info ...if allowed ....please me ......i don't want user enter id , password...thanks in advance
Comments
Post a Comment