2

このリンクを使用して、メール本文にテキストを含む画像を送信しています私のコードは以下に示されています

NSString *urlString = @"url";
NSString *searchingurl = [NSString stringWithFormat:@"%@%@", urlString,idnumber];
NSString *string = [NSString stringWithFormat:@"%@<br><br>Item No :%@<br>Type :%@<br>Size : %@",searchingurl,str123,mytype,itemsize];
NSMutableString *emailBody = [[[NSMutableString alloc] initWithString:@"<html><body>"] retain];
NSData *imageData = UIImageJPEGRepresentation(myImage, 1.0f);
NSString *encodedString = [imageData base64Encoding];
[emailBody appendString:[NSString stringWithFormat:@"<p><b><img src='data:image/png;base64,%@'></b></p>",encodedString]];
[emailBody appendString:string];
[emailBody appendString:@"</body></html>"];
NSLog(@"%@",emailBody);
 MFMailComposeViewController *emailDialog = [[MFMailComposeViewController alloc] init];
emailDialog.mailComposeDelegate = self;
[emailDialog setSubject:@""];
[emailDialog setMessageBody:emailBody isHTML:YES];
[self presentModalViewController:emailDialog animated:YES];
[emailDialog release];
[emailBody release];

上記コードのスクリーンショット

ここに画像の説明を入力

メールをYahooに送信した後、MackbookとiPhoneデバイスの両方に画像とテキストが表示されます.Gmailにメールを送信してiPhoneデバイスでチェックすると、テキスト付きの画像が表示されますが、MackbookでGmailをチェックすると画像が表示されません

私の画像が PC の Gmail に表示されない理由を教えてください。

4

1 に答える 1

-1
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
    picker.mailComposeDelegate = self;

    [picker setSubject:@"Your subject"];


    // Set up recipients
    NSArray *toRecipients = [NSArray arrayWithObject:@""];
    //NSArray *ccRecipients = [NSArray arrayWithObjects:@"second@example.com", @"third@example.com", nil];
    //NSArray *bccRecipients = [NSArray arrayWithObject:@"fourth@example.com"];

    [picker setToRecipients:toRecipients];
    //[picker setCcRecipients:ccRecipients];
    //[picker setBccRecipients:bccRecipients];


    NSLog(@"Video size >> %d",(videodta.length/1024)/1024);
  [picker addAttachmentData:imageData mimeType:@"image/png" fileName:@"testapp"];

    // Fill out the email body text
    NSString *emailBody = @"Type your message here";
    [picker setMessageBody:emailBody isHTML:NO];

    [self presentModalViewController:picker animated:YES];
    }
于 2013-02-13T17:39:56.043 に答える