我在 iphone 中使用 SKPSMTP 发送消息。我正在发送该消息,但我的帐户中没有收到邮件。
Actually it is happening when am i using my office mail(a@example.com) and server(mail.example.com). Am receiving mail to other mail(b@example.com) with same server but not to gmail, yahoo like that. Will any one please help me what is the reason behind that?
SKPSMTPMessage *mail = [[SKPSMTPMessage alloc]init];
mail.fromEmail = @"a@example.com";
//mail.toEmail = @"xxx@yahoo.in";
//mail.toEmail = [toMail objectAtIndex:i];
mail.toEmail = toMail;
mail.relayHost = @"mail.example.com";//@"smtp.mail.yahoo.com";//@"smtp.gmail.com";
mail.requiresAuth = YES;
mail.login = @"a@example.com";
mail.pass = @"aaaaaaa";
mail.subject = @"Testing using SMTP background app message ";
mail.wantsSecure = YES; // smtp.gmail.com doesn't work without TLS!
// Only do this for self-signed certs!
//mail.validateSSLChain = NO;
mail.delegate = self;
//email contents
NSString * bodyMessage = [NSString stringWithFormat:@"Hi , how r u? This is from my mail."];
mail.parts = [NSArray arrayWithObjects:plainPart, nil];
[mail send];