homepage Welcome to WebmasterWorld Guest from 54.197.215.146
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
how to send attachment by mail using perl script?
cccc




msg:431486
 12:26 am on Feb 27, 2004 (gmt 0)

hi

how to send an attachment by mail using a perl script?
if someone can post a script, I'll be very happy.

kind regards
cccc

 

flashfan




msg:431487
 9:41 pm on Feb 27, 2004 (gmt 0)


$mailer = MIME::Lite->new(From=>'',
To=>'',
Subject=>'',
Type=>'multipart/mixed');
$mailer->attach( Type=>'text/html',
Data=> $yourmessage);
$mailer->attach(Type=>"application/xls",
Path=>'',
Filename=>'',
Dispostion=>'attachment');
$mailer->send('smtp', $yoursmtpserver);

cccc




msg:431488
 12:24 am on Mar 1, 2004 (gmt 0)

hi flashfan

I tried but I get compilation errors.

#!/usr/bin/perl -w

use strict;
use warnings;
use MIME::Lite;

#MIME::Lite->send("sendmail", "/usr/sbin/sendmail -t -oi -oem");

$yoursmtpserver = "/usr/sbin/sendmail"

$mailer = MIME::Lite->new(From=>'root@mydomain.com',
To=>'postmaster@mydomain.com',
Subject=>'Hi',
Type=>'multipart/mixed');
$mailer->attach( Type=>'text/html',
Data=> $yourmessage);
$mailer->attach(Type=>"application/xls",
Path=>'/var/log.txt',
Filename=>'log.txt',
Dispostion=>'attachment');
$mailer->send('sendmail', $yoursmtpserver);

greetings
cccc

flashfan




msg:431489
 2:06 pm on Mar 1, 2004 (gmt 0)

Be sure you have MIME::Lite module installed.

cccc




msg:431490
 9:29 pm on Mar 3, 2004 (gmt 0)

hi flashfan

MIME::Lite is installed.

kind regards
cccc

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved