根据 MCOMessageBuilder.h ,我们可以使用SMTP发送邮件,如下所示:
MCOMessageBuilder * builder = [[MCOMessageBuilder alloc] init];
[[builder header] setFrom:[MCOAddress addressWithDisplayName:@"Hoa V. DINH" mailbox:@"hoa@etpan.org"];
NSArray * to = [NSArray arrayWithObject:[MCOAddress addressWithDisplayName:@"Gael Roualland" mailbox:@"gael@etpan.org"]];
[[builder header] setTo:to];
[[builder header] setSubject:@"A nice picture!"];
[builder setHTMLBody:@"<div>Here's the message I need to send.</div>"];
[builder addAttachment:[MCOAttachment attachmentWithContentsOfFile:@"/Users/foo/Pictures/image.jpg"]];
NSData * rfc822Data = [builder data];
但是,如果我想转发或回复其他电子邮件,我应该设置哪个属性? 我尝试了几种方法,例如设置 relatedAttachments , htmlInlineAttachments 等,但它没有效果。
我想知道我是否可以将其他电子邮件中的htmlBody与当前发送内容组合为HTML,然后设置setHTMLBody?