Aspose mail fails with google sync when attaching PDF

Hello.


I have a super strange problem.

When opening the attached msg file using outlook with common microsoft email servers, it works perfectly. Up to here, it’s a grate job guys :slight_smile: .

But, when using Google Sync for Microsoft Outlook, it fails when sending as HTML.

Please try this:
http://www.google.com/sync/index.html

I must say it’s very strange.

Kind regards,
Joao Schuler.


Hi Joao,


Could you please elaborate the problem and steps to reproduce this issue at our end? We’ll investigate it at our end as soon as possible and assist you further.

Follows steps:

0) Get a machine with Outlook 2007.
1) Install Google Sync
2) Open attached msg file and send.

You’ll see the attached error.

Kind regards,
Joao Schuler.

This is the code we use to create the message:


MailMessage message = new MailMessage();

message.setSubject(" “);
message.setHtmlBody(”");

AttachmentCollection attachments = message.getAttachments();
for (String fileName : fileNames) {
Attachment attObj = new Attachment(fileName);

String fileNameWithoutFolder = new File(fileName).getName();

attObj.setName(fileNameWithoutFolder);

message.addAttachment(attObj);
}
System.out.println("Attachment Count: " + attachments.size());

MailMessageSaveType.getOutlookMessageFormat());

MapiMessage mapiMsg = MapiMessage.fromMailMessage(message);

// Set the MapiMessageFlags as UNSENT and FROMME
mapiMsg.setMessageFlags(MapiMessageFlags.MSGFLAG_UNSENT | MapiMessageFlags.MSGFLAG_FROMME);

mapiMsg.save(outputFileName);

Sorry for sending so many messages. Just few more notes:

  • I have a user that gets the error messages with both Rich Edit and Html. But in my machine, it works with Rich Edit.
  • It seems that the problem only happens when there is an attachment.
Kind regards,
Joao Schuler.

Hi Joao,


Thanks for providing more information.

Could you please spare us little time to establish the environment and analyse the problem? We will soon right back here on the forum to share our findings.

Thanks for your patience and understanding in this regard.

Hi Joao,


Please accept our apology for delayed response.

I have installed Google Sync on a machine having Outlook 2007. I tried to create a user for Google Apps Sync however it raises errors stating “Google Apps Sync is only available for Google Apps for Business and Google Apps for Education accounts. Free Gmail accounts are not supported.”.

Could you please assist us more to re-produce this issue and provide steps to be performed ( including usage of Aspose.Email) after installation of Google Sync? If some business or education account is must required, then please also provide some test account credential to analyze the problem.

We are sorry for the inconvenience caused to you and your cooperation will be highly appreciated in this regard.

Hi Kashif,
You can create a free trial account here (doesn’t require credit card nor anything else):
http://www.google.com/intx/en_au/enterprise/apps/business/pricing.html

With above link, you can create a trial account that can be linked to Google Sync and test.

After successful installation/setup of Google Sync, please try step 2 in post [475108](https://forum.aspose.com/t/37398), you’ll find an error message.

Does this email clarify your question?

Kind regards,
Joao Schuler.

Hi Joao,


Thanks for your patience.

I created account as per your suggestion and then was successful in creating the Google Apps Sync user. I opened your sample message and tried to send it but failed due to error shown in the attached screen shot. I also created message draft copy using sample code and tried it with and without attachment, html body, text body etc. but nothing worked and same error message was shown.

I also created a draft message using Outlook 2007 and saved it on disc. When this message is opened for sending, it is found that same error is produced. This behavior shows that its not a bug in Aspose.Email for Java library but some internal issue of Google Sync.

Could you please create a draft message in Outlook 2007 and save it on disc? Try to send this message and see if same error is produced. If this is the case then you may post this problem on relevant forum for Google sync.

Hope above description clarifies the problem.

Please feel free to write us back if you have any other query related to Aspose.Email. We will be glad to provide you assistance.

Hi Kashif,
I can reproduce the test case you propose:

I also created a draft message using Outlook 2007 and saved it on disc.
When this message is opened for sending, it is found that same error is
produced. This behavior shows that its not a bug in Aspose.Email for
Java library but some internal issue of Google Sync.

I’m now convinced that this is a problem with Google Sync and have already opened 2 support requests with Google Apps Australia. If you could open another support request with google from your end, it might help us.

Thank you so much,
Joao Schuler.

Hi Joao,

Thank you for the feedback.

Please provide us the forum link where we can also report this issue to respective Google Sync end. We’ll also report this issue to help you further.