iOSのMfmailcomposerビューコントローラーにWebビューデータと画像ビューデータを追加する方法。他の人にメールを送るため。
4 に答える
2
あなたはできます Firest imageFull path Array を作成し、メールで必要なものを作成し、次のようにします:-
- (IBAction)sendemail
{
Class mailClass = (NSClassFromString(@"MFMailComposeViewController"));
if (mailClass != nil)
{
// We must always check whether the current device is configured for sending emails
if ([mailClass canSendMail])
{
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"Hello"];
//NSString *result = txtFiled.text;
for(NSString *dicsss in buttonss) // Hear buttonss its a ImagePathfull array
{
UIImage *imgvith = [UIImage imageWithContentsOfFile:[buttonss stringByAppendingPathComponent:dicsss]];
NSData *data = UIImagePNGRepresentation(imgvith);
[picker addAttachmentData:data mimeType:@"image/png" fileName:@"yourImagename"];
}
NSString *emailBody = @"Hi";
[picker setMessageBody:emailBody isHTML:YES];
[self presentModalViewController:picker animated:YES];
[picker release];
}
}
作業コードのスクリーンショットは次のようになります:-
于 2013-01-22T11:02:14.447 に答える
0
使用できます
for (UIImage *yourImage in YourImageArray )
{
NSData *imgData = UIImageJPEGRepresentation(yourImage, 0.5);
[mfMailComposer addAttachmentData:imgData mimeType:@"image/jpeg" fileName:[NSString
stringWithFormat:@"a.jpg"]];
}
于 2013-01-22T10:58:24.447 に答える
0
メール コンポーザー インスタンスに複数の画像を追加できます。ただし、ファイル名が異なることを確認してください。ここで確認してください: http://developer.apple.com/library/ios/#documentation/MessageUI/Reference/MFMailComposeViewController_class/Reference/Reference.html#//apple_ref/doc/uid/TP40008200-CH1-SW2。
于 2013-01-22T11:02:08.550 に答える
0
最善の解決策は
[mailCompose setMessageBody: msg isHTML: YES];
ここで、msg には次の値があります。
<body>
<img src='http://your_site/image1.jpg'>
<img src='http://your_site/image2.jpg'>
<br/>
<font face='Arial' size='2'>
Message Text<br/>
<br/>
</font>
于 2013-01-22T11:00:52.637 に答える