
Untitled
By: a guest on
Apr 30th, 2012 | syntax:
None | size: 1.33 KB | hits: 17 | expires: Never
Perl email script--content encoding issue
#!/usr/bin/perl
use strict;
use warnings;
#Character encoding var
my $encoding='text/plain; charset="iso-8859-5"';
#Create the message
use Email::MIME;
my $message = Email::MIME->create(
header_str => [
From => 'gmail@gmail.com',
To => 'gmail2@gmail.com',
Subject => 'I sent you this message using Perl.',
],
body_str => 'I sent you this message using Perl. One of those languages that would' would've been helpful much sooner in my life...',
);
use Email::Sender::Simple qw(sendmail);
sendmail($message);
body_str was given, but no charset is defined at /usr/local/share/perl/5.10.1/Email/MIME.pm line 243
Email::MIME::create('Email::MIME', 'header_str', 'ARRAY(0x9a04818)', 'body_str', 'I sent you this message using Perl. One ...') called at script.pl line 10
my $message = Email::MIME->create(
header_str => [
From => 'gmail@gmail.com',
To => 'gmail2@gmail.com',
Subject => 'I sent you this message using Perl.',
],
attributes => {
encoding => 'quoted-printable',
charset => "US-ASCII",
},
body_str => 'I sent you this message using Perl. One of those languages that would' would've been helpful much sooner in my life...',
);