I hope this is a super simple question for someone. I recently have had the need to switch a perl mailing script from using postfix to using straight smtp authentication. I settled on using Net::SMTP::SSL to do so, however, when I send an email I get unwanted header information in the body of the email. Is any one familiar with a way to suppress this? I do not want to see the header info at all in the emil. Here is a snippet of my code

while (<FILE>) { my $reciever = $_; $reciever = trim($reciever); print "sending to $reciever\n"; $smtp->mail($sender); $smtp->recipient($reciever); $smtp->data(); $smtp->datasend("To: <$reciever> \n"); $smtp->datasend("From: $sender_name <$sender> \n"); $smtp->datasend("Content-Type: text/html \n"); $smtp->datasend("Subject: $subject"); $smtp->datasend("\n"); $smtp->datasend($body); $smtp->datasend("\n"); $smtp->dataend(); } $smtp->quit;

(Keep in mind I am just testing and haven't written in any error checks or anything, I know some of you guys are pretty anal about that). Anyways, here is the output of the email I receive

This is a test Date: Fri, 10 Jul 2015 15:56:55 +0000 Message-ID: X-SES +-Outgoing: 2015.07.10-54.240.8.92 Feedback-ID: 1.us-east-1.vzpt/HASc5 +V1wxVDR8t2uShTrsuQZdG+MWGkCosTfe0=:AmazonSES X-AnalysisOut: [v=2.1 cv +=VYbjPTZ9 c=1 sm=1 tr=0 b=1 a=l4O7Z3VSsQrM948uWWFV] X-AnalysisOut: [m +A==:117 a=l4O7Z3VSsQrM948uWWFVmA==:17 a=hoWM_M7QAAAA:8 a=] X-Analysis +Out: [B8ibFTVmAAAA:8 a=YlVTAMxIAAAA:8 a=zOBTXjUuO1YA:10 a=MN8dvW] X-A +nalysisOut: [ad-vo2-9TkQDAA:9 a=dJ6bhRxdHoAA:10] Received-SPF: Pass ( +s12p02m024.mxlogic.net: domain of amazonses.com designates 54.240.8.9 +2 as permitted sender) X-Spam: [F=0.2000000000; B=0.500(0); STSI=0.50 +0(10); STSM=0.500(10); CM=0.500; CY=0.50; MH=0.500(2015071008); S=0.2 +00(2014051901); spf=0.500; SC=] X-MAIL-FROM: X-SOURCE-IP: [54.240.8.9 +2]

Everything beyond "This is a test" I would like gone

Thanks

In reply to Headers appearing in email body by edimusrex

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.