iphone发送邮件html,iPhone使用smtp服务器发送电子邮件?
在我的應用程序中,我能夠使用smtp服務器發送電子郵件,因為我輸入了正確的電子郵件ID和密碼.
但當我輸入我的Gmail或雅虎帳戶詳細信息時,我無法發送郵件.
因為我設置了relayHost = @“smtp.gmail.com”;然后我也無法發送郵件.
請幫我解決這個問題.
以下是我的代碼:
-(void)sendEMAIL{
SKPSMTPMessage *testMsg = [[SKPSMTPMessage alloc] init];
testMsg.fromEmail = str_uname;
NSLog(@"str_Uname=%@",testMsg.fromEmail);
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];
}
-(void)messageSent:(SKPSMTPMessage *)message{
[message release];
}
-(void)messageFailed:(SKPSMTPMessage *)message error:(NSError *)error{
[message release];
}
總結
以上是生活随笔為你收集整理的iphone发送邮件html,iPhone使用smtp服务器发送电子邮件?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 厦门大学和福州大学计算机专业哪个好,福州
- 下一篇: 计算机主机f不显示,为什么我不能按计算机