in reply to Re^6: How can I send email with attachments if MIME::Lite isn't available?
in thread How can I send email with attachments if MIME::Lite isn't available?

You don't need to have both a $msg->print(\*SENDMAIL); line and a $msg->send( 'sendmail', '/usr/lib/sendmail -t' ); line. That's at best redundant.

Try checking the return value of $msg->send(...). If it returns false, you've got failure. If it returns true MIME::Lite at least thinks it succeeded.

This is a CGI script, so your error messages (if any) should appear in the webserver's error log, unless you've used CGI::Carp with the fatalsToBrowser() option. That means it will be failing silently unless you dig into the webserver log. Whatever's in that log could be quite telling.

It's also possible that MIME::Lite has dependancies not satisfied by just copying Lite.pm into your local directory. As a matter of fact, if you're working with a CGI script, the script may not be executed with the working path you think it has, and that could result in Lite.pm not being found by your simple require. Again, this sort of thing would turn up in the error logfile for the webserver.

By the way, if someone were to hit your site with WWW::Mechanized, they could use it as an anonymous spam relay. The spam would look like an eCard with whatever text they choose to fill into the form. With a little forking they could hit you pretty hard. Beware of any CGI mailing script that allows the user the ability to send anonymously, and to set the recipient either via form data or manipulation of hidden fields. It's a bit of a security risk. It would be less useful as a spam relay if you explicitly limited the amount of text that could be sent in the message body down to a sentence or two.


Dave

Replies are listed 'Best First'.
Re^8: How can I send email with attachments if MIME::Lite isn't available?
by bigjoe11a (Novice) on Jun 23, 2005 at 02:09 UTC
    Sorry, Dave, I wanted to tell you that for some reason it working. I have have no idea why it's working now. A perl programer and I work on it for 3 days and still couldn't get it to send mail out. any way it's working, so thank you for your time. Joe