Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Install a module on a remote nix server 1

Status
Not open for further replies.

audiopro

Programmer
Apr 1, 2004
3,165
GB
The remote server I use for testing has the MIME::lite module installed already and I was over the moon when, with the help of you TT folks, I got his SMTP email working.

Then I hit a snag, my client is on a different ISP and MIME::lite is not installed. I have been looking round cpan for some instructions on how to install a module on a remote server. The docs say it is a stand alone module so I assume it can be installed within my web space and then called as required.
I see a tar.gz file and a makefile.pl but I am unsure what to do with them. Could someone point me to a good article, hopefully not written in tek speak, where I could learn how do do the install.


Keith
 
it assigns the value of "-" if $diff less than zero, otherwise it assigns the value of "+". That is the ternary operator:

$foo = condition ? true value : false value;

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
It's covered in the documentation:

Code:
Datestamp

    Optional. If given true (or omitted), we force the creation of a Date: field stamped with the current date/time if this is a top-level message. You may want this if using send_by_smtp(). If you don't want this to be done, either provide your own Date or explicitly set this to false.

So you can add to the param hash:

Date: => 0 (no date)

Date: => scalar localtime (localtime date)

Date: => 'Dec 25, 2007' (your own date)

Date: => \&date; (reference to a function that retuns a date)

etc
etc
etc



------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Thanks Kevin

I think localtime will be the most appropriate for our app. as it is all based in the UK.
Thanks for your help on this one - it was uncharted territory for me but now I have a bit of an understanding about modules.
I just hope that all this results in a working email app.

Keith
 
Getting further but now a problem with the call to sendmail within the MIME::Lite module.

Code:
/usr/lib/sendmail -t -oi -oem

reports
Inappropriate ioctl for device

I have googled for 'ioctl' and it suggests a setup problem on the host.
Any clues?

Keith
 
I have got it to work by changing
Code:
my $sendmailcmd = shift @_;
to
Code:
my $FromEmail = Source Email Address
my $Recipient = Recipient Email Address
my $sendmailcmd="/usr/lib/sendmail -f$FromEmail $Recipient";
as the ISP rejects any mail without the -f switch.

The problem now is how to get the variable Recipient into the module - then I can get some sleep.



Keith
 
I don't understand why you are doing this:

my $FromEmail = Source Email Address
my $Recipient = Recipient Email Address
my $sendmailcmd="/usr/lib/sendmail -f$FromEmail $Recipient";


from and recipient should be defined in the param hash, not as command line arguments to the sendmail application

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
I agree kevin but the ISP insist on having the sender email address on the command line, this they say should work. Up to now I have only been able to get it to send emails when I include both sender and recipient on the command line.

I can get it to work on another server, in its original form but this one is not playing the game and I need to get it working by last week.

This is all new to me but thanks to you, I am learning.
Is it acceptable to pass the recipient's address in the send call ie'
Code:
$msg->send('toyou@yoursite.com');
and access it from $_[1]
It works but I fear you may shout at me.


Keith
 
I hate to say it, but you're screwed. I would never agree to that stupid requirement. My best advise is to get out of this as fast as possible. This will just go on and on and on. Most of us have probably been in a similar situation, I know I have. Cut your losses and move on.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Thanks for your help on this - I might be screwed but I have learnt a lot about modules which can only be a good thing.
Now, for future reference, I need a decent tutorial on building modules - I'll have a sleep and then go and find something

Keith
 
I took your advice, moved ISP and we have been running for a while but I have hit another snag.

How do I get html links to appear as links within the body of the email?
eg. is only printed as plain text.
I suspect the 'type' is in some way responsible but text/html makes the script hang.
Code:
	$msg = MIME::Lite->new(
	From => '',
	To => $SendTo{$_[1]},
	Subject =>'oursite.com Administration',
	Type =>'multipart/related',
	Date => '0'	
	);

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top