Click here to get back home

Script to send file attachment with sendmail not working

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Script to send file attachment with sendmail not working Mortgageloan2004 11-20-2004
Posted by Mortgageloan2004 on November 20, 2004, 7:53 pm
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Posted by Bob Walton on November 20, 2004, 4:19 pm
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Similar ThreadsPosted
file attachment not working properly. November 14, 2004, 5:01 am
using Mail::Sender to send email with attachment April 17, 2006, 9:02 pm
Using MIME::Lite in Windows to send email with a zip attachment August 4, 2004, 2:53 pm
Cgi/Perl script for multiple file upload/attachment in web form November 4, 2004, 2:15 pm
How do I tell sendmail where to send bounced mail? August 1, 2008, 7:42 am
sendmail won't send me email but will the person filling out form November 5, 2005, 8:33 pm
LWP File Attachment question June 30, 2005, 11:47 pm
saving file attachment from mbox ? January 31, 2005, 12:44 pm
Problrms with decoding pdf file when iy goes as an attachment February 16, 2006, 1:42 pm
Email with text file attachment November 30, 2007, 7:18 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap