home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 1709
Discussions: 188,401, Posts: 2,243,608, Members: 232,631
Old July 17th, 2005, 11:23 PM   Digg it!   #1 (permalink)
Member
 
Join Date: Jul 2005
Location: Malaysia
Posts: 132
Question
cgi/perl with tripod

hello to all,

new to this forum...

i have a question about cgi/perl here...
actually, i have a small website where i hosted on Tripod on the last May...

Tripod doesn't use the "SendMail" Program as with the other web hosting, but instead the have a ready-made Perl Module which do the same( but Not Exactly the Same ) task as "SendMail" would do - processing email&sending it out.
the Perl Module i'm saying here is called "Tripod Mail.pm"...
I have opened and read that module, and i have seen their example of how to call that method used to send email in that module, and what should i need in order to use it and that it will work properly.

i was trying to create a feedback form on my site few weeks ago, but when i tested it, the form itself did working and was successfully processed, but then the email message - that was supposed to be sent to the user who fills up the form, was not sending at all...

i have been trying again and again, checked my script configuration, the file permission, researching for example scripts all over the internet, and i have been even sending a message to Tripod Help&Support...
but what happened was nothing but still the same result - the email was still not sending - neither to me nor the user!

i have also posted the same question( as this one i'm writing now ) to some forum hosting which talk about programming, but no one seems to be able to reply to my post...

so that, i really hope there will be at least one of you here who can probably help me to solve this matter - and that would be just much much appreciated!

- Thanks for reading! -
*** Hate me Love me, but Use me & I'll Help you - is this a riddle or a poem?... ***
__________________
I learnt from the best. YOU are amongst them!

LetMeKnow is offline   Reply With Quote
Old July 18th, 2005, 03:26 PM     #2 (permalink)
Banned
 
Iturea's Avatar
 
Join Date: Jan 2004
Location: Earth
Posts: 420
Lets see some code! :-)

Iturea is offline   Reply With Quote
Old July 19th, 2005, 10:54 AM     #3 (permalink)
Member
 
Join Date: Jul 2005
Location: Malaysia
Posts: 132
Quote:
Originally Posted by Iturea
Lets see some code! :-)
Did you mean that you want to see the code of my Script?
or... did you mean you have some example scripts for me?...

confused...

LetMeKnow is offline   Reply With Quote
Old July 19th, 2005, 03:34 PM     #4 (permalink)
Banned
 
Iturea's Avatar
 
Join Date: Jan 2004
Location: Earth
Posts: 420
Yeah lets see your mail script.
Iturea is offline   Reply With Quote
Old July 20th, 2005, 01:52 PM     #5 (permalink)
Member
 
Join Date: Jul 2005
Location: Malaysia
Posts: 132
Quote:
Originally Posted by Iturea
Yeah lets see your mail script.
Okay then, here goes...

This is the Tripod Mail.pm [ Just the Header of the Original Module Script... ]

************************************************** ***********************************
package TripodMail;

################
# TripodMail.pm #
################################################## ###########################
# TripodMail is a module that allows you to send out email messages with
# your scripts. In order to use it you'll have to have a mail template in
# your cgi-bin directory. The mail template will need to look something
# like this:

# To: $email
# From: FredFlintstone@hotmail.com
# Subject: YabbaDabbaDoo!
#
# Hello $name,
# Congratulations! You're user number $number of this mail script!

# You can add other email headers (Reply-To:, Errors-To:, etc), but To:
# and From: are manditory. You can customize your email by adding variables
# wherever you would like to fill something in on the fly.
# The sendMail method requires 2 parameters- the location of the mail
# template file, and a reference to a hash of variables.
# The keys of the varaible hash should correlate with the variables in the
# mail template.

# Example of use:
# require TripodMail;
# $MAIL = new TripodMail;
# $mail_template = "./flintstones_mail.txt";
# %variables = ('email' => 'Wilma@gurlmail.com',
# 'name' => 'Wilma',
# 'number' => '2');
# $MAIL->sendMail($mail_template, \%variables);

# Note: In order to prevent spamming, you will be limited to sending out 240
# mails per day.
################################################## #########################
************************************************** ***********************************

And Here is How did I try to Apply it to my Perl Script:-

************************************************** ***********************************
================================================== ==============================================
gBook.pl // Perl Script used to Send the Email
================================================== ==============================================
my $CGI = new TripodCGI;

my $number = $CGI->param('number');
my $name = $CGI->param('name');

open(LIST, ">>gBook_list.txt"); // Log Entries

print LIST <<END;
$name\r
END

close(LIST);

print <<END;
Content-Type: text/html\n\n

require Mail; // This is Okay even Not Using TripodMail
$mail = new Mail; // This is Okay even Not Using new TripodMail

$mail_template = "gBook.txt";
%templateVar = ('webmaster' => '// My E-mail Address is Here',
'name' => "$name",
'number' => "$number");

$mail->sendMail($mail_template, \%templateVar);

print <<END;
Content-Type: text/html\n\n

// This Space is an HTML Page added for Users to be shown after Submitting - Not Shown Here

END

================================================== ==============================================
gBook.txt // Mail Template used for the Email
================================================== ==============================================
To: $webmaster
From: My Web Site is Here
Subject: New Member on List - This is the Topic

$name
$number

************************************************** ***********************************

So, do you think I Missed something?... or made some Mistakes?...
I bet you can't answer...

But I hope you can answer... ;-)

Thanks in Advance!
LetMeKnow is offline   Reply With Quote
Old July 20th, 2005, 05:07 PM     #6 (permalink)
Banned
 
Iturea's Avatar
 
Join Date: Jan 2004
Location: Earth
Posts: 420
From: My Web Site is Here

Instead of putting your website address, put a valid e-mail address

(To:# and From: are manditory) I assume also that they must be correct in format as well. Such as valid e-mail addresses to prevent spam. You might want to check that the webmaster var is actually storing your e-mail address correctly when the template file loads.

Other than that I don't know enough about the e-mail component to know if your syntax is correct, but it looks like the example script although I don't know what the example template file looks like.
Iturea is offline   Reply With Quote
Old July 20th, 2005, 11:57 PM     #7 (permalink)
Member
 
Join Date: Jul 2005
Location: Malaysia
Posts: 132
okay, thanks!

i didn't think about that...
i took it from someone else anyway...
and i made it exactly as what he did it first.

i'll try to figure it out like that, and let you know what happen then.
LetMeKnow is offline   Reply With Quote
Old July 26th, 2005, 01:07 PM     #8 (permalink)
Member
 
Join Date: Jul 2005
Location: Malaysia
Posts: 132
Quote:
Originally Posted by Iturea
From: My Web Site is Here

Instead of putting your website address, put a valid e-mail address

(To:# and From: are manditory) I assume also that they must be correct in format as well. Such as valid e-mail addresses to prevent spam. You might want to check that the webmaster var is actually storing your e-mail address correctly when the template file loads.

Other than that I don't know enough about the e-mail component to know if your syntax is correct, but it looks like the example script although I don't know what the example template file looks like.
by the way...
can i put the "require TripodMail;" anywhere within a cgi/perl script?
or do i have to put it just after the "#!/usr/local/bin/perl"?

do i have to use the "package some::module" too?

perhaps that would be the problem here...

before this, i put that "require TripodMail;" in a "sub" part of my script...

i'm using activestate perl to test all cgi/perl scripts on my pc, but i don't have the PPM(the got a bit problem with that package... i just don't know why&where it is).

do i have to install the TripodMail.pm module on my perl program first before running any test into any cgi/perl scripts that uses the module?
LetMeKnow is offline   Reply With Quote
Old July 27th, 2005, 12:18 AM     #9 (permalink)
Member
 
Andybebad's Avatar
 
Join Date: Nov 2003
Location: Germantown Wisconsin
Posts: 90
Send a message via AIM to Andybebad Send a message via MSN to Andybebad
I'm pretty sure the "require TripodMail;" has to come after the shebang(#!/usr/local/bin/perl)
because isn't that how the server knows that it is a perl script and it has to use the perl program(can't think of the word right now)
Andybebad is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl/CGI help Siliconjunkie Webmastering and Programming 4 January 2nd, 2004 12:22 PM
perl/cgi, php prorgammer available alyak Webmastering and Programming 0 August 4th, 2003 12:07 PM
perl/cgi, php prorgammer available alyak Webmastering and Programming 0 August 4th, 2003 12:06 PM
iis & ACTIVE PERL WITH CGI BIN & BLAT? DeboNetwork Webmastering and Programming 1 February 28th, 2003 12:02 AM
No Marque on Tripod? techteen143 Webmastering and Programming 10 February 5th, 2003 10:54 PM

Most Active Discussions
Is It Just Me? (2906)
3-days in and no threads about Gaza (161)
Unarmed man on his stomach shot by .. (6)
New Build ( Finally ) (7)
CPU wont boot (7)
Building a gaming computer advice (5)
I think I just killed my computer w.. (24)
RCA 52Inch HDTV wont turn on (5)
Folderchat Weekday thread (444)
Recent Discussions
Laptop proccesor to desktop mob.. (2)
Please help! multiple problems! (4)
RCA 52Inch HDTV wont turn on (5)
New Build ( Finally ) (7)
Common Spyware Solutions (97)
How do you move a hard-drive to.. (4)
What is the best external enclo.. (0)
Partition Magic 7.0 (Unallocate.. (17)
For cheap price and good qualit.. (1)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 04:08 AM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28