CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Using send() method with MIME::LITE

 



keith73
Novice

Jul 5, 2000, 12:18 PM

Post #1 of 5 (634 views)
Using send() method with MIME::LITE Can't Post

Having a problem with MIME::LITE and have narrowed it down to a problem with the call to send.

Just to test it, I used the example I found at CPAN and tossed in my own email address, path and file to send. Still get 500 errors and no file is sent.

So I commented out just the $msg->send; portion of the code and no error occurred, of course, no message was sent either. I've tried bothe $msg->send and $msg->send() with the same results.

Here's some code:

$msg = new MIME::Lite
From =>'keith@powersolution.com',
To =>'webmaster@powersolution.com',
Subject =>'Testing MIME-Lite!',
Type =>'text/plain',
Encoding =>'base64',
Path =>'/fullserverpathtofile/imagename.gif';

$msg->send;

print "Content-type:text/html\n\n";
print "Message Sent...<p>\n";

This is not working but commenting out the call to send results in seeing the output, "Message Sent...".

This is just a tad frustrating because it looks like I'm doing it exactly like the example.

As always, any help is sincerely appreciated.

- keith


jacksonpt
Deleted

Jul 6, 2000, 4:06 AM

Post #2 of 5 (634 views)
Re: Using send() method with MIME::LITE [In reply to] Can't Post

I am just getting started with MIME::Lite, so I am by no means an expert. You may want to check the fact that you are sending: /fullserverpathtofile/imagename.gif
as your file, but you have typed it as:
Type =>'text/plain'.

Like I said, I am not an expert, but that seems contradictory to me.

Good luck,
-Jackson


keith73
Novice

Jul 7, 2000, 9:40 AM

Post #3 of 5 (634 views)
Re: Using send() method with MIME::LITE [In reply to] Can't Post

 
Did that with both a text file using text/plain and an image file using image/gif with the same results. It just won't cooperate.

- keith


rGeoffrey
User / Moderator

Jul 7, 2000, 1:27 PM

Post #4 of 5 (634 views)
Re: Using send() method with MIME::LITE [In reply to] Can't Post

By default MIME::Lite wants to send the mail using SENDMAIL. Are you sure you have it on your system?

Or you could try adding these lines to your program...

use Net::SMTP;
MIME::Lite->send('smtp', 'localhost', Timeout => 20);
$msg->send;

I think Net::SMTP is standard Perl, otherwise you will have to collect it from CPAN.

What little I know of MIME::Lite I learned from The Perl Journal #14, there are two articles in there that might help.

If you don't have it, you can go through tpj.com and get the source code from that issue. And I suppose there exists someone in the universe who would hope that after you read it, you like it so much you subscribe.


keith73
Novice

Jul 7, 2000, 7:02 PM

Post #5 of 5 (634 views)
Re: Using send() method with MIME::LITE [In reply to] Can't Post

Yes, SendMail is on the system I use it for other scripts. I will try your suggestion.

Thanks for the reply.

- keith

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives