CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Error in mail function: Edit Log



etheracide
journeyman

Jul 3, 2001, 10:03 AM


Views: 803
Error in mail function

I will explain this the best that I can, if you need more info, please let me know.

In my script I have a textfield named email. I set the value of email = $link. This is used to post the user's E-mail address into the page that the script generates. I then tried to set it up so that it would automatically send a thank you to the person who signed.

Here is the actual part for the auto thank you:

if ($link =~ /\@/) {
open (MAIL,"|$MAILPATH");
print MAIL "To: $link\n";
print MAIL "From: $MYEMAIL\n";
print MAIL "Subject: Thanks!\n";
print MAIL "Thank-you for signing my guestbook!\n
print MAIL "Please visit $TITLE again located at\n";
print MAIL "$SITE\n";
print MAIL "to see if anything new has been added\n";
print MAIL "since your last visit!\n\n";
print MAIL "--------------------------------------------\n";
print MAIL "Thanks,\n\n";
print MAIL "$MYNAME\n\n";
print MAIL "--------------------------------------------\n";
print MAIL "Powered by : Etheracidebook\n";
print MAIL "Copyright 2001 by Christopher-Michael Snyder\n";
print MAIL "http://wickedwebdesign.htmlplanet.com\n";
print MAIL "--------------------------------------------\n";
close (MAIL); }

(the format will be off on this code because I couldn't get it to fit into the box properly so this isn't the actual format of the code)

I tested the script and an E-mail was sent to the address associated with $link, but 'my' address "$MYEMAIL" also received the same E-mail. Each time that I test the script, it goes to the $link adress, but also to mine. After I straighten this out, I will add another mail function to have it send the user's values to "$MYEMAIL" to inform the administrator when someone signs their book, but i haven't put that in yet. I need to figure out why my address is receiving it as well. Probably too simple when I am looking for something too complex.

Is there something that I need to add to make sure that the $link in the mail inputs the latest value or something? I am stuck. Thank you for the time you spent reading this =0) As usual, i will make notice of the person who helps me on the site where I distribute my scripts =0) Thank you.



(This post was edited by etheracide on Jul 3, 2001, 9:20 AM)


This post has not been edited


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives