jason_s has asked for the wisdom of the Perl Monks concerning the following question:
When I run it, I get two mails (headers scrubbed): The mail sent using Mail::Stuff has a blank line in it:#!/usr/bin/perl use warnings; use strict; use Email::Stuff; my $body="line1\nline2\n"; my $to='jason@example.com'; #use email::stuff Email::Stuff->to($to) ->subject("hello from Email::Stuff") ->text_body($body) ->send; #use sendmail open ( MAILER, "|/usr/lib/sendmail -t" ); print MAILER "To: $to\n"; print MAILER "Subject: hello from sendmail\n"; print MAILER "$body"; close MAILER;
Return-Path: <jason@evo.u.lg.########.com> Received: from evo (##.###.126.68) by mailx.########.com (Kerio MailServer 6.7.1) for jason@########.com; Fri, 15 Jan 2010 15:12:39 -0800 Received: by evo (Postfix, from userid 516) id CD5CE2DBBBA; Fri, 15 Jan 2010 15:12:38 -0800 (PST) Date: Fri, 15 Jan 2010 15:12:38 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: quoted-printable To: jason@########.com Subject: hello from Email::Stuff Message-Id: <20100115231238.CD5CE2DBBBA@evo> From: jason@evo.u.lg.########.com (Jason Speck) line1 line2The mail sent via sendmail does not have a blank line in it.
Return-Path: <jason@evo.u.lg.######.com> Received: from evo (##.###.126.68) by ######.######.com (Kerio MailServer 6.7.1) for jason@######.com; Fri, 15 Jan 2010 15:12:39 -0800 Received: by evo (Postfix, from userid 516) id D9DBC81EACA; Fri, 15 Jan 2010 15:12:38 -0800 (PST) To: jason@######.com Subject: test using sendmail Message-Id: <20100115231238.D9DBC81EACA@evo> Date: Fri, 15 Jan 2010 15:12:38 -0800 (PST) From: jason@evo.u.lg.######.com (Jason Speck) line1 line2I suspect that Email::Stuff is doing what it's supposed to, but I'm just not understanding something about how mail works. I'd like to understand (1), where the blank lines after newlines are coming from, and (2) how to get rid of them so that I can get the formatting that I want.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: blank lines in email
by sflitman (Hermit) on Jan 16, 2010 at 05:48 UTC | |
by jason_s (Acolyte) on Jan 18, 2010 at 22:24 UTC | |
by gmargo (Hermit) on Jan 18, 2010 at 23:18 UTC | |
by jason_s (Acolyte) on Jan 19, 2010 at 02:05 UTC | |
by jason_s (Acolyte) on Jan 18, 2010 at 23:15 UTC | |
|
Re: blank lines in email
by holli (Abbot) on Jan 16, 2010 at 00:01 UTC | |
by jason_s (Acolyte) on Jan 16, 2010 at 00:05 UTC | |
|
Re: blank lines in email
by gmargo (Hermit) on Jan 16, 2010 at 15:01 UTC | |
|
Re: blank lines in email
by doug (Pilgrim) on Jan 17, 2010 at 17:11 UTC |