http://www.perlmonks.org?node_id=1165495


in reply to Re: adding carriage return to gmail script
in thread adding carriage return to gmail script

your first solution works adding the join, but adds the actual <br> into the email.
1a.txt<br> 1b.txt<br> 1c.txt<br> 1d.txt<br> 1e.txt<br> 1f.txt<br> 1g.txt<br> 1h.txt<br> 1i.txt<br> 1j.txt<br> 1k.txt<br> 1l.txt<br> 1m.txt<br> 1n.txt<br> 1o.txt<br>

Replies are listed 'Best First'.
Re^3: adding carriage return to gmail script
by NetWallah (Canon) on Jun 13, 2016 at 17:04 UTC
    Try adding content-type:
    $mail->send(-to .... -contenttype=>'text/html' );

            This is not an optical illusion, it just looks like one.

Re^3: adding carriage return to gmail script
by pryrt (Abbot) on Jun 13, 2016 at 17:52 UTC

    Sorry. I've never used the module. When I didn't see the newline between the list of filenames and the "total files pushed", I assumed that HTML was swallowing the newline. When I skimmed the documentation, I saw the <BR> but didn't notice the -contenttype=>'text/html', so thought I had confirmation that it defaulted to HTML; oops.

    Now looking at the source of the OP, I now see that since the output was not wrapped in <c></c>, the post hid the newline that was actually there.

    To fix the example code, either use NetWallah's suggestion of -contenttype=>'text/html', or remove the unnecessary <br>'s from my example.

      that works perfect! thanks!