Home  |  Linux  | Mysql  | PHP  | XML
From:Dennis Wicks Date:Fri Jun 26 04:27:24 2009
Subject:Need help with Mail::Sender
Greetings;

Following the docs I have it working, somewhat, but it is
not handling html w/inline images correctly.

Instead of getting an html message with inline image it is
sending a blank email with both the html and the jpg image
as attachments.

Here is my program. Does anyone see the problem?

Many TIA!
Dennis

=== === program follows === ===

> #!/usr/bin/perl
>
> use strict;
> use warnings;
> use Mail::Sender;
>
> my $image = 'kitten.jpg';
>
> my $sender = Mail::Sender->new( {
> smtp => 'smtpout.secureserver.net',
> port => '3535',
> from => 'tfrg@mgssub.com',
> auth => 'LOGIN',
> authid => 'tfrg@mgssub.com',
> authpwd => 'xxxxxxx'
> } );
> ref $sender or die
> "Object creation failed: $Mail::Sender::Error\n";
>
> my $recipients = 'gramps@mgssub.com';
>
> if (ref $sender->OpenMultipart({
> to => $recipients,
> subject => 'Test Sending HTML and inline message',
> boundary => '--boundarytest1',
> multipart => 'related'})) {
> $sender->Attach(
> {description => 'html body',
> ctype => 'text/html; charset=us-ascii',
> encoding => '7bit',
> disposition => 'NONE',
> file => 'test-inline.html'
> });
> $sender->Attach({
> description => 'kitten-1',
> ctype => 'image/jpg',
> encoding => 'base64',
> disposition => "inline;
filename=\"$image\";\r\nContent-ID: <img1>",
> file => "$image"
> });
> $sender->Close() or die "Close failed!
$Mail::Sender::Error\n";
> } else {
> die "Cannot send mail: $Mail::Sender::Error\n";}
Navigate in group perl.beginners at sever nntp.perl.org
Previous Next


Your recent visits
Re: Recursively filter an array
Re: script for shutdown remote machine
Re: Traversing Hash printing two times
AW: Using common object, without passing it around
Re: Traversing Hash printing two times



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants