We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to print the emails using Aspose.Network

Hi,

<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

<![endif]–><span style=“font-size: 12pt; font-family: “Times New Roman”,“serif”;”>I have one more problem regarding mails Printing. I want to
print the mails Directly when i retrieve the mails in my program using ImapClient.


This message was posted using Email2Forum by saqib.razzaq.

Hi Husain,

Thank you for inquiry.

I am sorry, we do not have printing support currently. I have added a new feature request in our system for printing the messages (ID: 17589). We will inform you when it gets implemented.

Has this feature been implemented. Is there a work arround?? Maybe export it to aspose Words?

Hi,

This feature is under development.

Aspose.Words for .NET support printing documents and yes a message can be exported to word and printed this way.

MailMessage message = MailMessage.Load(“message to print.msg”, MessageFormat.Msg);
// save to mhtml
MemoryStream mhtStream = new MemoryStream();
message.Save(mhtStream, MailMessageSaveType.MHtmlFromat);
mhtStream.Position = 0;
// load in Aspose.Words
Document document = new Document(mhtStream);
document.Print(“Printer Name”);

using (MemoryStream ms = new MemoryStream(file.Stored_File))

{

MailMessage mail = MailMessage.Load(ms, MessageFormat.Msg);

using (MemoryStream newMail = new MemoryStream())

{

mail.Save(newMail,

MailMessageSaveType.MHtmlFromat);

newMail.Position = 0;

Document doc = new Document(newMail, new LoadOptions { LoadFormat = LoadFormat.Mhtml });

doc.UpdatePageLayout();

using (MemoryStream thumbnail = new MemoryStream())

{

ImageSaveOptions imageOptions = new ImageSaveOptions(SaveFormat.Png);

imageOptions.PageIndex = 0;

imageOptions.PageCount = 1;

doc.Save(thumbnail, imageOptions);

file.Thumbnail = thumbnail.ToArray();

this.GenerateThumbnails(file);

}

file.Paginas = doc.BuiltInDocumentProperties.Pages;

file.Palabras = doc.BuiltInDocumentProperties.Words;

file.Parrafos = doc.BuiltInDocumentProperties.Paragraphs;

return null;

}

}

v
saqib.razzaq:
Hi,

This feature is under development.

Aspose.Words for .NET support printing documents and yes a message can be exported to word and printed this way.

MailMessage message = MailMessage.Load("message to print.msg", MessageFormat.Msg);
// save to mhtml
MemoryStream mhtStream = new MemoryStream();
message.Save(mhtStream, MailMessageSaveType.MHtmlFromat);
mhtStream.Position = 0; // load in Aspose.Words
Document document = new Document(mhtStream);
document.Print("Printer Name");


Hi, I have the same requirement (printing MSG from server). Is this still the correct method or does Aspose.Network now support printing?

Hi,

I am sorry, the printing support in not yet available with Aspose.Network for .NET. Currently, the above method needs to be adopted that uses Aspose.Words for .NET product.

The issues you have found earlier (filed as 17589 ) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

In v1.2, print to XPS support was added. Sample code is:


MailPrinter msgPrinter = new MailPrinter();
MailMessage msg = MailMessage.Load(“message.msg”, MessageFormat.Msg);
msgPrinter.Print(msg, “test.xps”, PrintFormat.XPS);


Email which is saved as a text file, using Perl can I parse it and retrieve or save it's attachment?