I have created a simple perl program that will take a users input from a form and email that input to me. The only problem is that i would like for it to be sent to my email in html format. I have created this program to send the input to an email address in text format and print a "thank you for filling out this form" to the browser in html format.
This is how I send to my email.
open (MAIL "|$mail_prog -t"
print MAIL "Contact Name:\n";
print MAIL "".$contactname."\n\n" ;
close (MAIL)
I know this is redundant because i have to create a new print statement for every single field i want to be printed to the email. How can i send this in html format? I would like to be able to send the field value to email only if the user has entered something. The way it is now it prints the "Contact Name" header everytime even if there is no input from the user.
I would appreciate any help!
Thanks,
Travis
This is how I send to my email.
open (MAIL "|$mail_prog -t"
print MAIL "Contact Name:\n";
print MAIL "".$contactname."\n\n" ;
close (MAIL)
I know this is redundant because i have to create a new print statement for every single field i want to be printed to the email. How can i send this in html format? I would like to be able to send the field value to email only if the user has entered something. The way it is now it prints the "Contact Name" header everytime even if there is no input from the user.
I would appreciate any help!
Thanks,
Travis