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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

email-a-friend

Status
Not open for further replies.

rtb1

IS-IT--Management
Jul 17, 2000
73
ES
I'm totally new to this and feel this is quite easy to solve hope somebody can help me.<br><br>I'm running a email-this site to a friend script from a Flash movie. The one I got to work is from Outel.<br><br>Quite basic but exactly what I needed for the Flash movie.However I would like to make it send an email as well to the visitor on the site to thank him. And this part I can't get to work please let me know what I should change in the script below<br><br>Thank you,<br><br>Raoul<br><br><br><br>------- script ---------------<br>#!/usr/bin/perl<br>##########################<br>#&nbsp;&nbsp;&nbsp;OutTel.com Scripts&nbsp;&nbsp;&nbsp;#<br>##########################<br><br>read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});<br>@pairs = split(/&/, $buffer);<br>foreach $pair (@pairs) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;($name, $value) = split(/=/, $pair);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$value =~ tr/+/ /;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(&quot;C&quot;, hex($1))/eg;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$value =~ s/\n/ /g;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$request{$name} = $value;<br><br><br>}<br><br>$url = &quot;<A HREF=" TARGET="_new"> = &quot;/usr/sbin/sendmail&quot;;<br><br>$stmail=&quot;$request{'stmail'}&quot; ;<br>$tmail=&quot;$request{'tmail'}&quot; ;<br>$tnmail=&quot;$request{'tnmail'}&quot; ;<br><br>print &quot;Content-type: text/html\n\n&quot;; <br>print &quot;&lt;Head&gt;&lt;title&gt;Sent!&lt;/title&gt;&lt;/head&gt;&lt;body&gt;\n&quot;;<br>print &quot;&lt;center&gt;&lt;BR&gt;Thank you for recomending this site.&lt;BR&gt;\n&quot;;<br>print &quot;The message has been sent.&lt;BR&gt;\n&quot;;<br>print &quot;&lt;BR&gt;&lt;A HREF=$url&gt;Go back to our web site.&lt;/A&gt;&lt;/center&gt;&lt;body&gt;\n&quot;;<br>print &quot;&lt;P&gt;&lt;P&gt;\n\n&quot;;<br><br>open (MAIL, &quot;¦ $maillocation -t&quot;) ¦¦ die &quot;aw, cant use $maillocation&quot;;<br>print MAIL &quot;To: $stmail\n&quot;;<br>print MAIL &quot;Reply-to: $tmail\n&quot;;<br>print MAIL &quot;Subject:check it!\n&quot;;<br>print MAIL &quot;Hey, I found a cool web site that might interest you.\n\n&quot;;<br>print MAIL &quot;Check it out at:\n&quot;;<br>print MAIL &quot;$url\n\n&quot;;<br>print MAIL &quot;From $tnmail\n\n;<br><br>###This is where the script ends, I added the next part###<br><br>close MAIL;<br><br>open (MAIL, &quot;¦ $maillocation -t&quot;) ¦¦ die &quot;aw, cant use $maillocation&quot;;<br>print MAIL &quot;To: $tmail\n&quot;;<br>print MAIL &quot;Reply-to: $stmail\n&quot;;<br>print MAIL &quot;Subject: Thanks!\n&quot;;<br>print MAIL &quot;Thank you for....<br>print MAIL &quot;$url\n\n&quot;;<br>print MAIL &quot;From $tnmail\n\n;<br><br>close Mail;
 
hi,<br><br>your line<br><FONT FACE=monospace><b><br>print MAIL &quot;Thank you for....<br></font></b><br>needs to read<br><FONT FACE=monospace><b><br>print MAIL &quot;Thank you for....\n&quot;;<br></font></b><br>same with<br><FONT FACE=monospace><b><br>print MAIL &quot;From $tnmail\n\n;<br></font></b><br>should read<br><FONT FACE=monospace><b><br>print MAIL &quot;From $tnmail\n\n&quot;;<br></font></b><br><br>pretty close for a first go though!<br><br>A hint -- if you always run with perl -w it will pick up this kind of error<br> <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Thanks Mike,<br><br>I will check this sort of errors again but I think this was just me trying to get this mail done quickly, When I was struggling to get it work I checked this sort of errors twice.<br><br>So except from the errors you quoted it should work?<br><br>Raoul<br>
 
Sorry for this, slow connection and not patient!
 
I checked it and it still gives errors even when I only add:<br><br>close MAIL;<br><br>without the code to send the second email.<br><br>Or should I expect this to happen?<br><br>raoul
 
open (MAIL, &quot;¦ $maillocation -t&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;¦¦ die &quot;aw, cant use $maillocation&quot;;<br>print MAIL &quot;To: $tmail\n&quot;;<br>print MAIL &quot;Reply-to: $stmail\n&quot;;<br>print MAIL &quot;Subject: Thanks!\n&quot;;<br>print MAIL &quot;Thank you for....\n&quot;<br>print MAIL &quot;$url\n\n&quot;;<br>print MAIL &quot;From $tnmail\n\n&quot;;<br>close Mail; <br><br><br>Hi Raol, could you add the code above please and, if it gives you an error, post the error message.<br><br>Oh - and did you use the -w switch?<br> <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Internal Server Error!<br><br>didn't use the -w switch. I did find a way around this from a Flash movie, it simply runs two scripts but still would like to find out what's wrong?<br><br>Thank you for your help,<br><br>raoul
 
Internal Server Error doesn't look like a Perl error....<br><br>What line is it failing on?<br> <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Internal Server Error is usually a HTTP error in the 500 range.&nbsp;&nbsp;It usually turns out to be a permissions problem on the script, or a syntax error... <p> <br><a href=mailto: > </a><br><a href= > </a><br>--<br>
0 1 - Just my two bits
 
It doesn't give any detailed information about the error!<br><br>I will contact my ISP again,<br><br>Thanks for helping,<br><br>Raoul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top