Plain Text - Imported email

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
bastiaan.c
Posts: 142
Joined: Sat Jun 22, 2013 9:24 pm

Plain Text - Imported email

Post by bastiaan.c »

Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:
Have you signed up for the FSS eSpotlight newsletter yet? You could
WIN a FSS gift card! See details below.

Hi,

If an email is imported into HESK > the text is converted in plain text if it wasn't already
My problem now is > That is comes in like this:

FREE Bowling – Single Airman Pre Labor Day Special!

All Single Airman are invited to enjoy free bowling and food specials
at the Ramstein Bowling Center on Friday, August 29th from 2000-2300.
All 30 lanes will be available, along with FREE shoe rentals! All you
have to do is “Show Up” and bowl. For more details, please call
0xxx-47-xxx.



Ii would like to have it like this:

Have you signed up for the FSS eSpotlight newsletter yet? You could WIN a FSS gift card! See details below.

FREE Bowling – Single Airman Pre Labor Day Special!

All Single Airman are invited to enjoy free bowling and food specials at the Ramstein Bowling Center on Friday, August 29th from 2000-2300. All 30 lanes will be available, along with FREE shoe rentals! All you have to do is “Show Up” and bowl. For more details, please call xxx-47-xxx
Is this something that can be done?

Thanks for all you do :-)
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Plain Text - Imported email

Post by Klemen »

This probably happens because the HTML part of the email has newlines hard-coded.

You can send a sample email that gets formatted like this to pop3test AT hesk and I will have a look.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
bastiaan.c
Posts: 142
Joined: Sat Jun 22, 2013 9:24 pm

Re: Plain Text - Imported email

Post by bastiaan.c »

Ok, a have sent the email :)
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Plain Text - Imported email

Post by Klemen »

Just as I though - if you look at the email source you will see these lines are here because the email contains <br> tags in those spots.

I'm afraid there is no reliable solution here; you could modify the function that converts HTML to text to convert <br> to space instead of new line, but there is no way of telling HESK which <br> tags are desired (new lines on purpose) and which generated by email client.

If you want to try this anyway, you can try changing file inc/mail/email_parser.php - find the second line that contains this code:

Code: Select all

// <br>
and in this line change

Code: Select all

"\n",
to

Code: Select all

" ",
Of course, this will only effect new emails, not existing ones.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
bastiaan.c
Posts: 142
Joined: Sat Jun 22, 2013 9:24 pm

Re: Plain Text - Imported email

Post by bastiaan.c »

Is it line 565 ?

Code: Select all

        "\n",                                   // <br>
I changed it into

Code: Select all

        " ",                                   // <br>
but it did not do anything :(

If I send new emails, the problem remains the same
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Plain Text - Imported email

Post by Klemen »

I checked it again and it won't work like that, because the lines are also broken with newline chars and HESK doesn't have a way of determining which newline chars to keep and which to remove.

I'm afraid I don't see a way around it (except creating some complex code to parse the HTML and clean newline chars and <br> from where it isn't needed).
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply