Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML Form (From Field)

Status
Not open for further replies.

TheSponge

Technical User
Jul 2, 2003
442
GB
Hi, really annoying me this...

I have many forms that can be submitted (HTML) on my site, so when the EMail arrives it just says from "none" I want it to say something like from "Feedback Form". Can I put a special tag in the form to say this?

I tried <input type=&quot;hidden&quot; name=&quot;from&quot; vaue=&quot;Feedback form&quot;>

No luck there...

Anyone?
 
You'll have to change whatever script is processing the form and sending the e-mail.

If you're just using mailto: to send the mail, then it's the user's e-mail program that has to supply the From field. If it's not putting anything in the From field then it's not configured correctly.

Kevin
A+, Network+, MCP
 
I assume you are using mailto in your form action.

try

action=&quot;mailto:billy@bob.com?Subject=HTMLisFun&quot;
 
Im not using the mailto tag, Im using my sendmail CGI script with the form tag:

<input type=&quot;hidden&quot; name=&quot;recipient&quot; value=&quot;me@myemail.com&quot;>

I managed to get a subject on the submitted Forms, by using <input type=&quot;hidden&quot; name=&quot;subject&quot; value=&quot;my subject&quot;>

But I still cant get the &quot;from&quot; to work? Thanks
 
You'll have to set up your script to accept a parameter for 'from' and use that to fill in the 'from' field. How are you sending the mail with your script? Are you using Net::SMTP? MIME::Lite?

Kevin
A+, Network+, MCP
 
Its just called sendmail, I`ve had a look at the script, Not sure where to put the parameter?

Thanks

JAMES
 
I found a sendmail cgi script that may be the same one you're using.
Is there a line in your script that starts with
Code:
my($sender)
?

Kevin
A+, Network+, MCP
 
The first few lines of the script are as follows:

#!/usr/bin/perl

$mailprog = '/usr/sbin/sendmail';

&get_date;
&parse_form;
&check_required;
&return_html;
&send_mail;

There is a line lower down which reads:

print MAIL &quot;To: $Config{'recipient'}\n&quot;;
print MAIL &quot;From: $Config{'email'} ($Config{'realname'})\n&quot;;

Thanks...
 
It looks like the from field is a combination of the email address and a name. You can try creating more hidden fields on your web page with the names 'email' and 'realname' and see if that does the trick.

If that doesn't work, see if there are other lines in the script that have 'email' or 'realname' in it and post them here.

Kevin
A+, Network+, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top