ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-win32-web
perl-win32-web
RE: Trying to Send mail
by Mike Crowl other posts by this author
Jan 31 2007 10:14AM messages near this date
view in the new Beta List Site
Trying to Send mail | Re: Trying to Send mail
What's the error?  That would be the biggest help in getting you an
answer.

 

________________________________

From: perl-win32-web-bounces@[...].com
[mailto:perl-win32-web-bounces@[...].com] On Behalf Of
Ben Eagle
Sent: Tuesday, January 30, 2007 1:57 PM
To: perl-win32-web@[...].com
Subject: Trying to Send mail

 

I am trying to get mail working but I have yet been able to get tit to
work properly, I am using MIME::Lite

 

Not sure what I am doing wrong

 

 

use MIME::Lite;

 

# set up email

$to = "beagle\@alinean.com, beneagle\@earthlink.net";

$from = "me\@example.com";

$subject = "Email Sent via Perl";

$message = "This email was sent using Perl.";

$file = "graph1.jpg";

 

# send email

email($to, $from, $subject, $message, $file);

 

# email function

sub email

{

 # get incoming parameters

 local ($to, $from, $subject, $message, $file) = @_;

 

 # create a new message

 $msg = MIME::Lite-> new(

  From =>  $from,

  To =>  $to,

  Subject =>  $subject,

  Data =>  $message

 );

 

 # add the attachment

 $msg-> attach(

  Type =>  "image/jpeg",

  Path =>  $file,

  Filename =>  $file,

  Disposition =>  "attachment"

 );

 

 # send the email

 MIME::Lite-> send('smtp', 'email01.alinean.com', Timeout => 60);

 $msg-> send();

}

 

 

it gives me a error on  $msg-> send();

 

not sure why

 

 
Thread:
Ben Eagle
Mike Crowl
Bill Luebkert

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved