PDA

View Full Version : How can I send notification to sender on cardsite


oldman
02-07-2003, 06:48 PM
Hi All
I hope this is not a dumb question as I am just learning cgi. I have an Ecard site I have put together and it is working fine but does not notify sender when the card is picked up. Is there a way to do this from the email that is sent to the recip. or must it be coded in the script. My webhost uses Sendmail if this makes a difference. Any help will be greatly appreciated.
Thanks

ACJavascript
02-08-2003, 09:02 PM
In this ecard scripts,, when the user sends the card does the card get put on your server? then the person getting the card come and see it?

or is the card sent in the email?

oldman
02-09-2003, 12:47 AM
Thanks a lot for Replying
The card gets printed to a file and the recipient is mailed a link address to the file and must click on the link in the email to access the file on my server.
Any help will be greatly appreciated, I'm thinking it may be something really simple to accomplish but I mam just learning to work with perl and cgi and need all the help I can find
Thanks Again
Oldman

ACJavascript
02-09-2003, 04:35 PM
I have never worked with E-card scripts so a question..

When this page is generated can anyone see it??

or just the person it was sent to?

oldman
02-09-2003, 11:30 PM
Hi ac,
When the card is generated by the script it is printed to a file using the server date and time as the filename.html The file name is then emailed to the recip. as a link in the email the recip can click to view the card. It is only accessable thru the emailed link and not accessible by anyone else. When the link in the email is clicked on it opens the html file that was generated by the script which contains the pic and message that the sender had filled into the form. The html file also contains the senders name, email address,and the recips. name and email address.
I hope this may help as I am completely confused as to how to get it to automatically email the to the senders addr. when the html file is accessed.
Thanks, seeya
oldman

ACJavascript
02-10-2003, 01:09 AM
hu,, cool hehehe.. Well this is how I would go about it.

First I would have it create a .cgi page instead of a .html page.

Then I would have this code on the top of the .cgi page to automaticly email the user who sent the card..

You will probably have to play with it a bit to fit your script and your server ect.....

--------
#Your mailprogram
$mailprog="/usr/sbin/sendmail";

# the email address for the person sending the card
$SenderEmail=$FORM{'sendersEmail'}

open(MAIL,"|$mailprog -t") || print "Can't open mail program!\n";
print MAIL "To:$SenderEmail\n";
print MAIL "Subject:IT has been recieved\n";
print MAIL "Your e-card has been read!\n";
close(MAIL);

## NOW put here all your html

print <<EOF;
<html>
<head>
<title>Card - o2342390487234 ect...</title>
</head>
<body>
Hey your friend bob sent you this card ect.....

</body>
</html>
EOF

exit;
-------

Now the form for the persons email,, That would be set into a variable when the script is created on the fly,, That way when it is called it has the variable ready to send the email address to the MAIL....

Thats how I would go about it,, Don't know if it would work,, In theory it should lol,, ya never know though lol :D:D

oldman
02-10-2003, 02:10 AM
Hi Ya a c
Thanks for the help, will give it a try and see what happens.
Will let you know when I have some news
Again Thanks Alot, Looks like it should work,

ACJavascript
02-10-2003, 04:36 PM
Cool,, I hope it does work for ya hehe :D:thumbsup: