Forum Moderators: coopster & phranque

Message Too Old, No Replies

confirmation email msg

         

daphreephunkateer

2:41 pm on Mar 10, 2004 (gmt 0)

10+ Year Member



i've got a competition running on my website - the user puts in their name and email address, submits it, and the data gets sent to me in an email.

how do you send a confirmation email to the email address that they entered in the text field?

thanks in advance for any help.

coopster

3:16 pm on Mar 10, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Why not run a subroutine right after the email is sent to you? Just change the
To:
to the value in the submitted form's email and modify the subject and message to notify of confirmation?

daphreephunkateer

3:58 pm on Mar 10, 2004 (gmt 0)

10+ Year Member



thanks for the advice...

not 100% sure what a subroutine is...

any chance someone could give me an eg...?

thanks in advance.

ukgimp

4:06 pm on Mar 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



[uk.php.net...]

Just extract the email and put it into the mail() function

coopster

5:01 pm on Mar 10, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Hey ukgimp, that's the PHP mail function! LOL. We're in the Perl forum :)

A subroutine [perldoc.com] is a chunk of code inside your CGI script to perform common tasks. You are already sending one email to yourself, now you want to send one to the form submitter. Seems like a logical place to use a function.

More resources:
Can I pass variables to a perl subroutine this way [webmasterworld.com]