LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Looking for Information

[ILUG] Looking for Information

Peter Heslin Peter.Heslin at ucd.ie
Thu Feb 3 02:58:01 GMT 2000


On Wed, Feb 02, 2000 at 02:30:34PM -0000, Eleanor Duff wrote:
> Does anyone anything about converting a Perl script from Linux/Unix for
> use in an NT enviornment?
> I have a contact HTML form running off an Apache Server. Aperl script
> grabs the information, puts it to the screen in HTML format, so the
> customer can see what they have sent, the it opens the sendmail utility
> on the Unix box and sends it to me in the format of an e-mail with the
> data collected, listed in it.

I've heard that Sendmail has been ported to NT, so installing that
might be one way to go (but I have no experience with it myself). 

>  I wish to replicate the forms on my IIS server, and use the Perl forms
> to call a MS-DOS based mailing program. Is there anyway of doing this
> conversion, a utility or script I can use that will allow the batch file
> to be called?
>

You could easily rewrite the relevant bit of the script to use a more
platform independent module instead of calling sendmail directly.
Install the MailTools bundle on the NT box by downloading the .ppm
binary from www.activestate.com.  Then install it on the linux box:
perl -MCPAN -e shell and type install Mail::Send at the prompt.

Cutting and pasting from the manual, the code you need to write will
look something like this:

require Mail::Send;

$msg = new Mail::Send;

$msg = new Mail::Send Subject=>'example subject', To=>'user at host';

# Launch mailer and set headers. The filehandle returned
# by open() is an instance of the Mail::Mailer class.

$fh = $msg->open;

# This is where you output your data, using the print command.

print $fh "Body of message";

$fh->close;         # complete the message and send it

		
HTH,
Peter







Check
out the documentation to Mail::Mailer.  IIRC, it tries several
options: it'll use Sendmail if its available, but failing that, it can
send SMTP directly to the server of your choice.  There's a note on this
in perldoc perlfaq9 and for all the mail modules you could want, see:
http://search.cpan.org/search?mode=module&query=mail

Make sure that the module of your choice is also available as a .ppm
binary for Windows at www.activestate.com.  I see a bundle there
called MailTools, which should contain Mail::Send.  Once your improved
script runs on the Linux box, it should then run on NT, provided that
the necessary module has been installed there.

Peter




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell