1
我使用MFMailComposeViewController以發送電子郵件,如何設置電子郵件正文中的某些文本之後的第一個圖像?
有了這個代碼,我能夠得到的圖像,但圖像來後的文本細節, 我wan't第一圖像和文字後,
這裏是我的代碼,
MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
mail.mailComposeDelegate = self;
if ([MFMailComposeViewController canSendMail]) {
//Setting up the Subject, recipients, and message body.
[mail setToRecipients:[NSArray arrayWithObjects:Emailid,nil]];
[mail setSubject:@"Receipt"];
NSData *photoData = UIImageJPEGRepresentation([UIImage imageNamed:@"Gift.png"], 1);
[mail addAttachmentData:photoData mimeType:@"image/jpg" fileName:[NSString stringWithFormat:@"photo.png"]];
[mail setMessageBody:@"Receipt" isHTML:NO];
NSString *emailBody;
emailBody = [NSString stringWithFormat:@
"<br>Purchase Amount: </br> " "$ %@"
"<br>Amount Received: </br> " "$ %@"
"<br>Change: </br> " "$ %@"
,AmountData,txtAmount.text,ChangeAmount.text];
[mail setMessageBody:emailBody isHTML:YES];
請任何機構建議我我該怎麼做?
謝謝Alok,我剛剛在我的aEmail正文中添加了我的base64String代碼,並且它的工作正常。 – Anki 2012-04-09 05:37:49
有了這個imageData base64EncodedString,我能夠在iPhone郵件詳細信息中顯示圖像,但無法獲取Gmail帳戶中的圖像,我該如何解決這個問題,任何建議? – Anki 2012-04-11 14:40:06
其實我沒有太多的知識呢 – 2012-04-12 07:05:22