[Solved]Create Basic Cgi Allows User Enter Following Information Html Form Sends E Mail Specified Q37270248

Create a basic CGI that allows the user to enter the following information into an HTML form and then sends an e-mail to the specified address: K Your e-mail address (the “from* address) K Your recipient’s e-mail address (the “to address) K A topic (the “subject of the e-mail) K A message or comment So, you’ll be creating at least two files for this assignment. One will be the HTML form page, and one will be the CGI script that sits behind it and does the processing Youาเ want to make sure that after your CGI script has decoded the form’s information and sent the mail that you display some sort of Congratulations! Successfully sent the mail” web page message back to the browser. You will need to produce a messages (see Grading Notes and sample screen shots) if any of the four fields are not filled in. all appropriate error If you’d like to add functionality to your feedback form and/or the CGI script, please feel free to do so. It must at least satisfy the minimal requirements given here. My only request is that you dont make your feedback form so complex that I need to fill in 800 fields just to send a simple message via the form. The only required fields should be returm address, to address, subject and message. A simple “enhancement” would be to link back to the HTML form from the results of your CGl script, allowing the user to click back to the form and send another message Try this program out in your Unix account /usr/bin/perl use Modern:: Perl use Mail::Sendmail; # required to use the Mail: :Sendmail library use your address here instead of me@somewhere.com for testing purposes my $mai1To mee somewhere.com ‘ ; in your CGI, this will be value of Param() # us@ your address her@ instead of neenowhere.com for testing my Smail1From- me@nowhere.com. ; # in your CG1, this will be value of param() my $subjectLine my $message “Sample Subject”; “Sample Message” ; # in your CGI, this will be value of param() # in your CGI, this will be value of param() my imail-To From $mai1From Subject ubjectline MessageSmessage must be a string, not an array Content-type’ .text/plain ゆ tsendmai1 imail print “Successfully sent mail to aiToCheck your boxin” else print “Error sending mail: SMail:: Sendmail::error In” This program will send e-mail to the e-mail address listed in $mai 1 To and from the e-mail address listed in $mailFrom. Notice the use of single quotes on those scalars. This is needed because we don’t want Perl to try and interpolate Bnowhere or @somewhere as arrays. Make sure you capitalize all the right things in that code to make sure it works correctly Once you’ve tested this code and find that it works to send mail to the Smai 1To address from the Smai1From address, you can incorporate parts of this code into your CGI program. Show transcribed image text Create a basic CGI that allows the user to enter the following information into an HTML form and then sends an e-mail to the specified address: K Your e-mail address (the “from* address) K Your recipient’s e-mail address (the “to address) K A topic (the “subject of the e-mail) K A message or comment So, you’ll be creating at least two files for this assignment. One will be the HTML form page, and one will be the CGI script that sits behind it and does the processing Youาเ want to make sure that after your CGI script has decoded the form’s information and sent the mail that you display some sort of Congratulations! Successfully sent the mail” web page message back to the browser. You will need to produce a messages (see Grading Notes and sample screen shots) if any of the four fields are not filled in. all appropriate error If you’d like to add functionality to your feedback form and/or the CGI script, please feel free to do so. It must at least satisfy the minimal requirements given here. My only request is that you dont make your feedback form so complex that I need to fill in 800 fields just to send a simple message via the form. The only required fields should be returm address, to address, subject and message. A simple “enhancement” would be to link back to the HTML form from the results of your CGl script, allowing the user to click back to the form and send another message
Try this program out in your Unix account /usr/bin/perl use Modern:: Perl use Mail::Sendmail; # required to use the Mail: :Sendmail library use your address here instead of me@somewhere.com for testing purposes my $mai1To mee somewhere.com ‘ ; in your CGI, this will be value of Param() # us@ your address her@ instead of neenowhere.com for testing my Smail1From- me@nowhere.com. ; # in your CG1, this will be value of param() my $subjectLine my $message “Sample Subject”; “Sample Message” ; # in your CGI, this will be value of param() # in your CGI, this will be value of param() my imail-To From $mai1From Subject ubjectline MessageSmessage must be a string, not an array Content-type’ .text/plain ゆ tsendmai1 imail print “Successfully sent mail to aiToCheck your boxin” else print “Error sending mail: SMail:: Sendmail::error In” This program will send e-mail to the e-mail address listed in $mai 1 To and from the e-mail address listed in $mailFrom. Notice the use of single quotes on those scalars. This is needed because we don’t want Perl to try and interpolate Bnowhere or @somewhere as arrays. Make sure you capitalize all the right things in that code to make sure it works correctly Once you’ve tested this code and find that it works to send mail to the Smai 1To address from the Smai1From address, you can incorporate parts of this code into your CGI program.
Expert Answer
Answer to Create a basic CGI that allows the user to enter the following information into an HTML form and then sends an e-mail to… . . .
OR

