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.
In reply to blank lines in email by jason_s
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |