topache
04-26-2005, 04:24 AM
Hi,
Please I need your help.
I'm trying to make something out of a cgi form mail script.
I have everything working so far except for 1 little detail that is giving me a headache.
What I'm trying to accomplish is to have a form someone can fill out where they type in the begining of an email address in 1 field (ex johndoe) then from a drop down list select the second part (ex @you.com or @me.com) then fill out the other 2 fields and be able to send that to the approciate place. (either johndoe@you.com or johndoe@me.com).
If you look at my script below you can see where I'm trying grab the begining and end of the email using 2 fields. It runs without any errors, but I don't get the email sent to me.
Can anyone help PLEASE! and THANKYOU!!
Part of the html form where I have the 2 fields, 1 to type in johndoe and the selection list to select either @you.com or @me.com
<TD align="left" width="20%"><B>Email Address:</B></TD>
<TD><input type="text" name="first">
@<select name="second" size="1">
<option value="@me.com" selected>me.com</option>
<option value="@you.com">you.com</option>
</select>
********Part of the cgi:*********
use strict;
use CGI;
my $cgiobject = new CGI;
my $MailProgram = '/usr/lib/sendmail';
my $first =$cgiobject->param("first");
my $second =$cgiobject->param("second");
print "Content-type: text/html\n\n";
open (MAIL,"|$MailProgram -t") || &errormess;
print MAIL "To: $first($second)\n"; ***************
print MAIL "From: $email_add\n";
print MAIL "Reply-to: $email_add\n";
print MAIL "Subject: Email From Your Website\n";
print MAIL "Name $fname\n";
print MAIL "email $email_add\n";
print MAIL "Msg $email_msg\n";
close(MAIL);
Where you see my ***** is where I'm trying to open my sendmail and have it put in an email to: johndoe@you.com ($first which it typed and @you.com which is selected)
Thanks for any help
Please I need your help.
I'm trying to make something out of a cgi form mail script.
I have everything working so far except for 1 little detail that is giving me a headache.
What I'm trying to accomplish is to have a form someone can fill out where they type in the begining of an email address in 1 field (ex johndoe) then from a drop down list select the second part (ex @you.com or @me.com) then fill out the other 2 fields and be able to send that to the approciate place. (either johndoe@you.com or johndoe@me.com).
If you look at my script below you can see where I'm trying grab the begining and end of the email using 2 fields. It runs without any errors, but I don't get the email sent to me.
Can anyone help PLEASE! and THANKYOU!!
Part of the html form where I have the 2 fields, 1 to type in johndoe and the selection list to select either @you.com or @me.com
<TD align="left" width="20%"><B>Email Address:</B></TD>
<TD><input type="text" name="first">
@<select name="second" size="1">
<option value="@me.com" selected>me.com</option>
<option value="@you.com">you.com</option>
</select>
********Part of the cgi:*********
use strict;
use CGI;
my $cgiobject = new CGI;
my $MailProgram = '/usr/lib/sendmail';
my $first =$cgiobject->param("first");
my $second =$cgiobject->param("second");
print "Content-type: text/html\n\n";
open (MAIL,"|$MailProgram -t") || &errormess;
print MAIL "To: $first($second)\n"; ***************
print MAIL "From: $email_add\n";
print MAIL "Reply-to: $email_add\n";
print MAIL "Subject: Email From Your Website\n";
print MAIL "Name $fname\n";
print MAIL "email $email_add\n";
print MAIL "Msg $email_msg\n";
close(MAIL);
Where you see my ***** is where I'm trying to open my sendmail and have it put in an email to: johndoe@you.com ($first which it typed and @you.com which is selected)
Thanks for any help