Hi,
I am creating an email and then embedding an image into it. That is all working fine. The issues is that there is a .bin file attached to the email. This is causing confusion with the recipient, as they want to open the .bin file. Do you know how I can stop that from being attached?
Here is a sample of the code.
<!— create the message objects —>
MailMessageFile = server.asposeLoader.create(“com.aspose.email.MailMessage”).init()
MapiMessageFile = server.asposeLoader.create(“com.aspose.email.MapiMessage”).init()
objMapiMessageFlags = server.asposeLoader.create(“com.aspose.email.MapiMessageFlags”)
<!— add the Images —>
tmpImg = server.asposeLoader.create(“com.aspose.email.LinkedResource”).init(“g:\folderpath\image001.png”, “application/octet-stream”)
tmpImg.setContentId(“Logo”)
MailMessageFile.getLinkedResources().add(tmpImg)
tmpImg = server.asposeLoader.create(“com.aspose.email.LinkedResource”).init(“g:\folderpath\image004.gif”, “application/octet-stream”)
tmpImg.setContentId(“kids”)
MailMessageFile.getLinkedResources().add(tmpImg)
<!— subject —>
MailMessageFile.setSubject(“Response to asdf’s Form 470 #1234”)
<!— body —>
MailMessageFile.setHtmlBody(‘
blah
<!— Set the recipient of the message —>
mailContact = server.asposeLoader.create(“com.aspose.email.MailAddressCollection”).init()
mailContact.add(‘asdf@asdf.com’)
MailMessageFile.setTo(mailRecipient)
<!— create Mapi message and save —>
outlookMsg = MapiMessageFile.fromMailMessage(MailMessageFile)
outlookMsg.setMessageFlags(bitor(objMapiMessageFlags.MSGFLAG_UNSENT, objMapiMessageFlags.MSGFLAG_FROMME))
outlookMsg.save(“g:\folderpath\asdf_1234_mapi.msg”)
Thanks
This message was posted using Email2Forum by Babar Raza.