I'm trying to import email into a web app and when opening the email in the web app it shows the text like so:
"b'Your ticket has new correspondence added by x. \r\n\r\nView this ticket on the Client Portal at clientportal.com\r\n\r\nAlternatively you can view ticket updates from your mobile device by installing and logging into the x mobile app.\r\n \r\nIf you would prefer to receive greater details regarding your ticket updates in these messages please elect to receive encrypted emails."
My code:
descr=item.body
descr = descr.replace("\r","\\r")
descr = descr.replace("\n","\\n")
descr = descr.encode('ascii', 'ignore')
try:
gotdata = spitit[3]
except IndexError:
I am trying to remove the '\r\n\r\n' from before the text. I'm also not sure whay the 'b'' is appearing at the start of the text.