Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xcode UIImage发送到电子邮件_Xcode_Email_Uiimageview_Uiimage - Fatal编程技术网

Xcode UIImage发送到电子邮件

Xcode UIImage发送到电子邮件,xcode,email,uiimageview,uiimage,Xcode,Email,Uiimageview,Uiimage,在我的程序中,在运行时修改图像,我必须通过电子邮件发送它。不需要保存在设备中。有什么建议吗 我使用它,但不起作用,因为图像没有保存在iphone中=( }您可以使用该功能从UIImage提取png格式的数据。您可以使用该功能从UIImage提取png格式的数据。您可以尝试此功能。要进入的图像: UIImage *UIImageToSend; 代码呢 MFMailComposeViewController *composer = [[MFMailComposeViewController all

在我的程序中,在运行时修改图像,我必须通过电子邮件发送它。不需要保存在设备中。有什么建议吗

我使用它,但不起作用,因为图像没有保存在iphone中=(


}

您可以使用该功能从
UIImage
提取png格式的数据。您可以使用该功能从
UIImage
提取png格式的数据。您可以尝试此功能。要进入的图像:

UIImage *UIImageToSend;
代码呢

MFMailComposeViewController *composer = [[MFMailComposeViewController alloc] init];
[composer setMailComposeDelegate:self];
if([MFMailComposeViewController canSendMail]) {
    [composer setToRecipients:[NSArray arrayWithObjects:@"JanJaap@Korteweg.nl",nil]];
    [composer setSubject:@"A nice subject"];
    [composer setMessageBody:@"Hi,\n\nI'm sending you this beautiful photograph." isHTML:NO];
    [composer setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];

    NSData *data = UIImageJPEGRepresentation(UIImageToSend,1);
    [composer addAttachmentData:data  mimeType:@"image/jpeg" fileName:@"Photograph.jpg"];

   [self presentModalViewController:composer animated:YES];
}

你可以试试这个。要进入的图像:

UIImage *UIImageToSend;
代码呢

MFMailComposeViewController *composer = [[MFMailComposeViewController alloc] init];
[composer setMailComposeDelegate:self];
if([MFMailComposeViewController canSendMail]) {
    [composer setToRecipients:[NSArray arrayWithObjects:@"JanJaap@Korteweg.nl",nil]];
    [composer setSubject:@"A nice subject"];
    [composer setMessageBody:@"Hi,\n\nI'm sending you this beautiful photograph." isHTML:NO];
    [composer setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];

    NSData *data = UIImageJPEGRepresentation(UIImageToSend,1);
    [composer addAttachmentData:data  mimeType:@"image/jpeg" fileName:@"Photograph.jpg"];

   [self presentModalViewController:composer animated:YES];
}

您的手机上是否有正确配置的电子邮件帐户?您的手机上是否有正确配置的电子邮件帐户?我使用此帐户但不适用于我的新图像,因为我没有保存在mi iphone中。您有其他想法吗?我使用此帐户但不适用于我的新图像,因为我没有保存在mi iphone中。您有其他想法吗?