Quantcast
Channel: Aspose.Email Product Family
Viewing all 1367 articles
Browse latest View live

Error reading PST file

$
0
0
I got error when reading messages from PST file using code below:

PersonalStorage pst= PersonalStorage.fromFile(pstFile);
FolderInfo folderInfo = pst.getRootFolder();
procedFolder(folderInfo, pst);

private void procedFolder(FolderInfo folderInfo, PersonalStorage pst) {
int contentCount=folderInfo.getContentCount();
int position=0;
while(position<contentCount){
int end=position+1000;
if(end>contentCount-1)
end=contentCount-1;
MessageInfoCollection messageInfoCollection = folderInfo.getContents(position, end);
for (int i = 0; i < messageInfoCollection.size(); i++) {
MessageInfo messageInfo = (MessageInfo) messageInfoCollection.get(i);
MapiMessage m=null;
try{
m = pst.extractMessage(messageInfo);
}
catch (Exception e){
logger.error("Failed to load message ", e);
continue;
}
}
position=end;
}
}

in pst file is about 8000 messages

java.lang.IllegalStateException: Could not read message
at com.aspose.email.hx.a(Unknown Source)
at com.aspose.email.PersonalStorage.extractMessage(Unknown Source)
at com.evizone.rbp.imports.PST.PSTConnectorA.procedFolder(PSTConnectorA.java:94)
at com.evizone.rbp.imports.PST.PSTConnectorA.procedFolder(PSTConnectorA.java:121)
at com.evizone.rbp.imports.PST.PSTConnectorA.openPSTFile(PSTConnectorA.java:82)
at com.evizone.rbp.imports.PST.PSTConnectorA.<init>(PSTConnectorA.java:72)
at com.evizone.rbp.imports.SaveMailMessage.main(SaveMailMessage.java:521)
Caused by: com.aspose.email.ms.System.IllegalArgumentException: '50000' is not a supported codePage
at com.aspose.email.private.e.d.c(Unknown Source)
at com.aspose.email.hx.a(Unknown Source)
at com.aspose.email.hx.a(Unknown Source)
at com.aspose.email.hx.a(Unknown Source)
at com.aspose.email.hx.a(Unknown Source)
... 7 more

after first message wich generate exception above all others generate exception belove


java.lang.NullPointerException
at com.aspose.email.hx.a(Unknown Source)
at com.aspose.email.PersonalStorage.extractMessage(Unknown Source)
at com.evizone.rbp.imports.PST.PSTConnectorA.procedFolder(PSTConnectorA.java:94)
at com.evizone.rbp.imports.PST.PSTConnectorA.procedFolder(PSTConnectorA.java:121)
at com.evizone.rbp.imports.PST.PSTConnectorA.openPSTFile(PSTConnectorA.java:82)
at com.evizone.rbp.imports.PST.PSTConnectorA.<init>(PSTConnectorA.java:72)
at com.evizone.rbp.imports.SaveMailMessage.main(SaveMailMessage.java:521)

Formatting header when saving message to MHTML?

$
0
0
Are there any formatting options available when saving an email message to MHTML and using MailMessageSaveOptions.WriteHeaderToMht?

My two primary concerns in order of importance are:

1) There is no spacing between the headerLineTitle span and the headerLineText span.  For example, you will get lines like "To:John Doe" or "Subject:Test" with no space after the colon.  This looks bad.

2) You use a fixed format for the send date in the header (possibly RFC2822?).  But this is uncommonly used when someone would actually print an email in Outlook.  Ideally I would like to specify the desired standard or custom .NET DateTime format string here.

In general, I'd like the header to more closely represent what you get when printing from Outlook since our intention is to do the MSG->MHTML->PDF conversion process.

Cannot create an Appointment - NullPointerException

$
0
0
The following code works on Windows 7, but it fails on Windows Server 2003 (Tomcat)

Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
Date startDate = calendar.getTime();
calendar.add(Calendar.HOUR, 1);
Date endDate = calendar.getTime();

MailAddressCollection attendees = new MailAddressCollection();
attendees.add(...);
MailAddress organizer = new MailAddress(..., ...);
Appointment app = new Appointment("", "", messageBody, startDate, endDate, organizer, attendees);

This is the exception I get on the last line:
       at com.aspose.email.Appointment.resetTimeZone(Unknown Source)
at com.aspose.email.Appointment.<init>(Unknown Source)
at com.aspose.email.Appointment.<init>(Unknown Source)
at com.aspose.email.Appointment.<init>(Unknown Source)
at com.aspose.email.Appointment.<init>(Unknown Source)


I need some help ASAP as it happens in production.

Thanks,
Mariusz

Error: Could Not fetch message within 100ms

$
0
0

Hi Support,

After useig your new DLL I am receiving the error "An message couldn't be fetched within 100 ms". Not sure why I have not changes any code. The only change is DLL file. I am getting error at the below line of cede.

Aspose.Email.Mail.MailMessage ProcessMessage = MailClient.FetchMessage(ProcessIndex);

Please Help ASAP...

Cheers,

ValuePRO

Encoding Problem with msg-Format Unicode/Standard

$
0
0
Hi!

I've attached a simple application to demonstrate the issue. The app converts *.msg in the program folder to word documents.

The same Message was saved as Unicode and std. Outlook-Message. The problem is that characters like 'öüä' are not correct displayed in both szenarios (the HtmlBody is loaded incorrect).

Is this a bug or can you give me a hint how to open/convert both messages correct?

Thanks
Wolfgang

Dynamic fields in .msg file

$
0
0

Hi

I've created a email template in Outlook and saved it as a .Msg file. I want to put dynamic fields in the email body. How can I use Aspose.Email to populate these dynamic fields.

See attached example, I have #Name# where i get the persons name from a database. How can I replace these fields in the .Msg file?

thanks

AJ

 

Convert msg document to pdf

$
0
0

I have .msg files saved to the file system.

I need to convert these files to pdf.

I have seen that with Aspose.Words and Aspose.Cells, it's very simple to save doc and xls files to pdf, but declaring a new email message does not let me give it a file location (that i can tell so far).

Could you point me in the right direction?

Thank you,

lshaffer

Adding Task to PST

$
0
0
Hi,

I can see the MapiTask supported in the api. but can you confirm if we can add it to PST. I dont see any such example or code sample.


NullPointerException while creating an appointment on windows server 2003

$
0
0
Hi,

This code generates NullPointerException on Widnows Server 2003. Can you suggest any alternate?

 

Appointment app = new Appointment("Appointment Location", "Appointment Summary", "Appointment Description",

             startDate, endDate,

             new MailAddress("organizer_address@aspose.com", "Organizer"), attendees);

 

app.save("app.ics");

Poor picture quality when sent from Aspose.Email

$
0
0

Hi

I used Aspose.Email to email an outlook message file. If I send the email to an exchange account it comes out fine. But if I send it to a Gmail/Hotmail account text inside the rectangle changes in to an image but it's in a very bad quality. If I use the same template and send it using Outlook to a Gmail/Hotmail account picture quality is much better.

See the attach pictures for comparisons.  I used the code from my ealier post. http://www.aspose.com/community/forums/thread/454562/dynamic-fields-in-.msg-file.aspxhttp://www.aspose.com/community/forums/thread/454562/dynamic-fields-in-.msg-file.aspx

is there a flag i can set to improve this?

 

 

 

Invalid URI: The format of the URI could not be determined

$
0
0

I purchased Aspose.net.email on 13 Jan 2012. This has been working fine. Recently I got the error "Invalid URI: The format of the URI could not be determined" when trying to save mails. I found the solution on the forum. This was a bug in your system. But now when I try and use this version, it says that my license is only valid to versions up to 13 Jan 2013. The version I need is 27 Jan 2013.

So per this, I need to upgrade the subscription.

Now I don't think this is really fare. The problem is a bug in your software.

Broken link observed while transfering ..msg file to RTF/PDF

$
0
0

Hi,

We observe broken link in RTF/PDF output from .msg file.

PFA - image of output and source(JP-1doc- MSG with Attachments JP家庭動物.txt - please change extension from .txt to .msg)

Can you please have a look at this issue and let me know.

Thanks,

Satyendra Acharya

Long Execution time for retrive message

$
0
0

Hello, 

I' m a developer of the alfaproject.

I' m testing the aspose.email v 2.7.0.0 to purchase it.

The target is develop a Windows Service that run in background and download messages stored in a Exchange folder.

This is the code of my application:

   Private Sub DownloadAllEmail(ByVal FolderName As String, Optional ByVal mode As ExchangeListMessagesOptions = ExchangeListMessagesOptions.ListRecursive)

       Try

           Dim ExchangeConnection As ExchangeWebServiceClient

           ExchangeConnection = New ExchangeWebServiceClient(Settings.ConnectionServer, _

                                       Settings.ConnectionUsername, _

                                      Settings.ConnectionPassword, _

Settings.ConnectionDomain)

 

           Dim FolderURI As String = ExchangeConnection.MailboxInfo.InboxUri

           Dim MessageCollection As ExchangeMessageInfoCollection = _

                                      ExchangeConnection.ListMessages(FolderURI, mode)

           For Each MessageInfo As ExchangeMessageInfo In MessageCollection

               Dim StringMessageURI As String = MessageInfo.UniqueUri

               Dim message As Aspose.Email.Mail.MailMessage = ExchangeConnection.FetchMessage(StringMessageURI)

               Dim tempMessage As String = EmailFolder & "Message_" & message.Date.ToString("yyyyMMddhhmmss") & EmailExtension

               message.Save(tempMessage, Aspose.Email.Mail.MessageFormat.Eml)

           Next

           ExchangeConnection.Dispose()

       Catch ex As Exception

           LogOperation("[DownloadAllEmail]: " & ex.Message, EventLogEntryType.Error)

       End Try

   End Sub

 

The execution time is over 10 minutes for retrive 135 message from a single folder ( Too much).

Often the connection with the server is dropped and this is a problem.

 

Are these behaviours due by  trial version?

Thanks.



MailAddress : problem with long encoded display name

$
0
0
Hello,

We encounter a blocking problem using MailAddress (Aspose Email 2.8)  and encoded long display name.

This code works for a short encoded display name :
MailMessage mm = new MailMessage();
mm.To.Add(new MailAddress("test@example.com", "é 0123456789", Encoding.GetEncoding("iso-8859-15")));
mm.From = new MailAddress("test@example.com");
mm.TextBody = "Test TO";
mm.Save(@"c:\temp\ok_short.eml", MailMessageSaveType.EmlFormat);

It works for a long non encoded display name (even if it generates an unnecessary line break at the beginning of the resulting eml To header) :
MailMessage mm.To.Add(new MailAddress("test@example.com", "e 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789", Encoding.GetEncoding("iso-8859-15")));
mm.From = new MailAddress("test@example.com");
mm.TextBody = "Test TO";
mm.Save(@"c:\temp\ok_long.eml", MailMessageSaveType.EmlFormat);

But it fails for a long encoded display name :
MailMessage mm = new MailMessage();
mm.To.Add(new MailAddress("test@example.com", "é 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789", Encoding.GetEncoding("iso-8859-15")));
mm.From = new MailAddress("test@example.com");
mm.TextBody = "Test TO";
mm.Save(@"c:\temp\nok_long.eml", MailMessageSaveType.EmlFormat);

Here is the resulting eml for the last example :
To: "
 =?utf-8?B?w6kgMDEyMzQ1Njc4OSAwMTIzNDU2Nzg5IDAxMjM0NTY3ODkgMDEyMzQ1Njc4? =?utf-8?B?OSAwMTIzNDU2Nzg5IDAxMjM0NTY3ODkgMDEyMzQ1Njc4OQ==?=" <test@example.com>
From: test@example.com
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

Test TO

Regards,
AVM Informatique

MhtMessageFormatter gets confues by german special characters

$
0
0
Hi,

i'm using Aspose.Email.dll 2.8.0.0 for email to pdf conversion.

1. Reading email in *.msg format
2. Formatting email via MhtMessageFormatter
3. Save email in *.mhtml Format
4. Reading *.mhtml document via Aspose.Words.dll
5. Save word document as pdf file.

It seems Aspose.Email.dll gets confused by german special characters (this is in step 3).


Example Code:

Aspose.Email.License mailLic = new Aspose.Email.License();
mailLic.SetLicense("c:\\temp\\lic.lic");

Aspose.Words.License wordLic = new Aspose.Words.License();
wordLic.SetLicense("c:\\temp\\lic.lic");

MailMessage msg= MailMessage.Load("c:\\temp\\demo.msg");

MailMessageSaveOptions mailSaveOptions = MailMessageSaveOptions.None;
MhtMessageFormatter mailFormatter = new MhtMessageFormatter();
mailFormatter.FromFormat = "<span class=\"headerLineTitle\">Von:</span><span class=\"headerLineText\"> {0}</span>  "; //Wichtig: korrekte Anführungszeichen " benutzen
mailFormatter.DateTimeFormat = "dd.MM.yyyy HH:mm";
mailFormatter.SentFormat = "<span class=\"headerLineTitle\">Gesendet:</span><span class=\"headerLineText\"> {0}</span><br>";
mailFormatter.ToFormat = "<span class=\"headerLineTitle\">An:</span><span class=\"headerLineText\"> {0}</span><br>";
mailFormatter.SubjectFormat = "<span class=\"headerLineTitle\">Betreff:</span><span class=\"headerLineText\"> {0}</span><br>";
mailFormatter.BccFormat = "<span class=\"headerLineTitle\">Bcc:</span><span class=\"headerLineText\"> {0}</span><br>";
mailFormatter.CcFormat = "<span class=\"headerLineTitle\">Cc:</span><span class=\"headerLineText\"> {0}</span><br>";
mailFormatter.AttachmentFormat = "<span class=\"headerLineTitle\">Anlagen:</span><span class=\"headerLineText\"> {0}</span><br>";

mailFormatter.Format(msg);

msg.Save("c:\\temp\\demo.mht", MailMessageSaveType.MHtmlFromat, mailSaveOptions);

Aspose.Words.LoadOptions loadOpt= new Aspose.Words.LoadOptions();
loadOpt.LoadFormat = LoadFormat.Mhtml;
Aspose.Words.Document doc = new Document("c:\\temp\\demo.mht", loadOpt);
doc.Save("c:\\temp\\demo.pdf", SaveFormat.Pdf);

My plattform:
Windows 8 64 Bit
Aspose.Words 13.3.0.0
Aspose.Email 2.8.0.0
internal bugid#4917


How to properly handle email attachments from a MSG file and sent via outgoing SMTP email

$
0
0

I am reading large number of emails (6000+) extracted from a PST file and saved as individual MSG files in a folder. Majority of these individual MSG emails have numerous attachments of all file types (JPG, DOC, PDF, XSL, PNG, BMP etc).

I have tried both the methods file save as well as memory stream and have run in to issues.

When I use file save method as shown below, few emails and attachments are saved properly but duplicate attachment file names create problems and I am unable to delete these attachment files after email is sent. The exception is "Cannot delete as file is in use".

//Get all the email message attachments
int i = 0;
foreach (MapiAttachment _attachment in _message.Attachments)
{
   _attachment.Save(@"C:\PST_Extractor\MSG_Attachment\" + i + "__" + _attachment.FileName);
   Emsg.Attachments.Insert(i, new System.Net.Mail.Attachment(@"C:\PST_Extractor\MSG_Attachment\" + i + "__" + _attachment.FileName));
   i++;
}

When I use the memory stream method as sown below, emails and their attachments go out properly. But when I try to open the received email attachments they do not open and I get an error saying that attached files are damaged. The error screen-shot in case of a PDF attachment is attached for your reference.

//Get all the email message attachments
foreach (MapiAttachment _attachment in _message.Attachments)
{
   MemoryStream _ms = new MemoryStream();
   _attachment.Save(_ms);
   Emsg.Attachments.Add(new System.Net.Mail.Attachment(_ms, _attachment.DisplayName));
}

Can anyone help that what do I need to do in case of memory stream email attachment method so the attached files sent via email can be opened and viewed correctly?

Getting exception in msg splitting

$
0
0
Hi,

I am trying to split msg mail, getting following error

java.lang.IllegalArgumentException: length

            at com.aspose.email.ms.System.IO.f.a(Unknown Source)

            at com.aspose.email.co.a(Unknown Source)

            at com.aspose.email.co.a(Unknown Source)

            at com.aspose.email.co.a(Unknown Source)

            at com.aspose.email.co.a(Unknown Source)

            at com.aspose.email.co.a(Unknown Source)

            at com.aspose.email.co.a(Unknown Source)

            at com.aspose.email.co.a(Unknown Source)

            at com.aspose.email.co.a(Unknown Source)

            at com.aspose.email.co.<init>(Unknown Source)

            at com.aspose.email.MapiMessageReader.<init>(Unknown Source)

            at com.aspose.email.MapiMessage.a(Unknown Source)

            at com.aspose.email.MapiMessage.fromStream(Unknown Source)



Sorry, due to proprietary reason, can not share the email.

Please let me know, what can cause this error.

Exception converting .eml to .msg for meeting with non-US date

$
0
0

I'm using Aspose.Email to convert .eml files to .msg files. I've encountered a couple of cases where converting a meeting message with specific content (or lack thereof) will generate an exception.

I'm using this code to do the conversion

MailMessage msg = MailMessage.Load("file.eml", MessageFormat.Eml);

msg.Save("file.msg",MailMessageSaveType.OutlookMessageFormat); <-generates exception

In this case, I have a text/calendar MIME section in the .eml file that has a recurrence entry which has a TimeZone parameter. If the TZID is as shown below, I get an exception with a message of String was not recognized as a valid DateTime (the line may be wrapped here in the forum but it is all on one line in the file).

RECURRENCE-ID;TZID="(UTC+01:00) Brussels, Copenhagen, Madrid, Paris":20130325T143000

If, however, I change that line so that the TZID is: Eastern Standard Time, the conversion works.

RECURRENCE-ID;TZID=Eastern Standard Time:20130325T143000

Here's the full text/calendar section (I know there is a mix of Time zones in the file. It still seems to hinge on the recurrence item)

Content-Type: text/calendar; charset="utf-8"; method=REQUEST
Content-Transfer-Encoding: 8bit

BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:Microsoft Exchange Server 2010
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Eastern Standard Time
BEGIN:STANDARD
DTSTART:16010101T020000
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
ORGANIZER;CN=ES1TU 000003:MAILTO:ES1TU000003@customer.local
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=ES1TU 0000
 04:MAILTO:ES1TU000004@customer.local
DESCRIPTION;LANGUAGE=en-US:When: 13 April 2013 08:00-08:30 (UTC-05:00) East
 ern Time (US & Canada).\nWhere: my office\n\n*~*~*~*~*~*~*~*~*~*\n\nThis i
 s first test\n\n
SUMMARY;LANGUAGE=en-US:test meeting
DTSTART;TZID=Eastern Standard Time:20130413T080000
DTEND;TZID=Eastern Standard Time:20130413T083000
UID:040000008200E00074C5B7101A82E008000000000043F24A5B2CCE01000000000000000
 0100000003B1B807E8E7E4C4AAED6C88159B2ADFC
RECURRENCE-ID;TZID="(UTC+01:00) Brussels, Copenhagen, Madrid, Paris":20130325T143000
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20130329T125625Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:0
LOCATION;LANGUAGE=en-US:my office
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-OWNERAPPTID:-1357039651
X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-DISALLOW-COUNTER:FALSE
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:REMINDER
TRIGGER;RELATED=START:-PT15M
END:VALARM
END:VEVENT
END:VCALENDAR

Exchange Web Services Supported For Exchange 2007 SP1?

$
0
0

I am using Aspose.Email to connect to an Exchange mailbox using the ExchangeWebServiceClient.  When I run the code and try to connect to an Exchange 2007 instance, I receive the error "The request failed with an empty response."

This site is also using an ISA server that I have to go through, but I have other code that uses Exchange Web Services outside of Aspose.Email at this same site and it has no problems connecting.  I simply have to set my ExchangeVersion property to Exchange2007_SP1.

From what I read in these posts, it seems you want us to use the WebDav method with 2007, do I understand that correctly, or is there a way to use the ExchangeWebServiceClient with Exchange 2007?

The Aspose.Emal version I am using is 2.3.0.0.

I just tried version 2.6.0.0 and I get the same result.

 

EWS Custom Headers (w/ and w/o Impersonation)

$
0
0
Using the MailMessage object we were adding a custom header with the .Add_("X-Custom", "MyValue")

We were saving this message to the drafts folder via AppendMessage.

Upon sending this email from Outlook or OWA,. the Sent Items folder contained the custom header in the mail options. However when the mail was received, the custom header was missing. This result happened no matter which user we logged into the EWS service with. It did however work for one user in particular (which we weren't able to track why, perhaps a permissions issue).

We were using impersonation as well to save the draft in other user's draft folders. But when we saw this issue we took this out of the equation in the event this was causing the issue. Removing impersonation however did not change the outcome, the headers were still stripped.

We then decided to use the EWS Managed API by Microsoft to achieve our goal. We added the custom header and saved the draft (through regular and impersonation) and after sending the draft from the client, the mail message contained the custom headers in the inbox of the recipient.

Is Aspose Email using the EWS Managed API under the hood at all? The only other big difference in code I noticed was that we are doing an auto discover on the service uri after providing the credentials, where in Aspose Email we have to specify the uri. Using EWS however, I specified the same uri we were passing to Aspose and the headers still came through appropriately.

Aspose.Email for .NET 4.0
Version 2.7.0.0

Thank you in advance and please let me know if you need any additional information.
Viewing all 1367 articles
Browse latest View live