Friday, 15 August 2014

html - Microsoft Outlook python new line character -


I am trying to figure out how to send some output to my Outlook mailbox from Python script. Now I have some problems with formatting. My original method is below

  def email_mailbox (file_checked, error_list): error_msg = 'for error in e-mail: if not e: e + =' \ n 'error_msg + = e if lane ( Error_MS g) & gt; 1: error_msg + = '\ n Automatic Test Result: Failed' Other: Error_MS g = 'Automated Test Result: PASSED' msg = MIMEText (error_msg) msg ​​['topic'] = 'Automatic review' + file_checked [: - 6 ] Msg ['from'] = 'a' msg ['to' '] [' 'B' 's = SMTPL MTP ('Sms SMTP') Asemail ('a', 'b', mms.as_string ()) s. ) The print (file_check + 'review email sent')  

The problem with this is that when I send out large amounts of output, for some unknown reasons, some lines do not appear on a new one The line is

Enter image details here

to open Using the Note Pad for the Email Address I can see that the formatting looks ok

  UBNZI91D P < BR & gt; UBNZI09M P & lt; BR & gt; UBNZC66D P & lt; BR & gt; UBNZC66D Quantitative Resources Not Correct & lt; BR & gt; UBNZC67D P & lt; BR & gt; UBNZC67D Quantitative processing is not correct & lt; BR & gt; UBNZC68D P & lt; BR & gt; UBNZC68D quantitative resources are not correct & lt; BR & gt; UBNZC69D P & lt; BR & gt; UBNZC69D quantitative resources are not correct & lt; BR & gt; UBNZF08D P & lt; BR & gt; UBNZEND1 P & LT; Br> 

My dragon skill is fine and I'm pretty sure this is an encoding problem, but for me I can know why its format is not correct. For

  has tried: If E is not: new_line = '& lt; BR & gt; ' New_line.encode ('ascii', 'xmlcharrefreplace') e + = new_line error_msg + = e  

Reading plain text of a generic text email that I found here with no luck, which I sent it in the perspective, of me

   & Lt; Body & gt; & Lt ;! - Converted from text / plain format - & gt; & Lt; P & gt; & Lt; Font size = 2 & gt; New line & lt; BR & gt; New line & lt; BR & gt; & Lt; BR & gt; Cheers, & lt; BR & gt; & Lt; BR & gt;  

Any help would be greatly appreciated in this mystery

Automatically automate Outlook from your preferred programming language. Look and describe all the possible ways of working with text messaging bodies in MSDN.

Keep in mind, Microsoft currently does not support Microsoft Office applications from any unrestricted, non-interactive client applications, or components (including ASP, ATP, ATP, DCOM and NT services) because The office can display unstable behavior and / or deadlock when Office is run in this environment.

If you are building a solution that is a server-side reference, you should try to use components that are safe for no performance execution. Or, you should try to find out the options that allow for at least part of the code to run client-side. If you use an Office application with server-side solution, there will be a lack of several necessary capabilities to successfully run the application. In addition, you will take risks with the stability of your overall solution. See for more information.


No comments:

Post a Comment