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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recieving miltiple E-Mails from Send mail

Status
Not open for further replies.

usakjw

Programmer
Sep 8, 2005
47
US
I have a form on my website that I receive multiple emails from with on submission. The first is from the actual person who filled out the form. This is the one that I want, and contains all the information that I want. The second is from the master e-mail account. I do not understandhow this is happening.

Their is more code then what is list below. I have only posted the code that is responsible for sending the email.

#Format and send the E-mail
#Where is E-mail Program
$mailprog = '/usr/lib/sendmail';

#Who gets E-mail
$recipient = 'test@test.com';

#Who is the mail from
$from = $mes{email};

#Open mail program or dienice
open (MAIL, "|$mailprog -t") or dienice("Can't find Mail Program!!\n");

print MAIL "From: $from\n";

print MAIL "To: $recipient\n\n";


print MAIL "Subject: New Guest Book Entry\n\n";

print MAIL "Name: $mes{'fname'} $mes{'lname'}\n";
print MAIL "Age: $mes{'age'} Precint: $mes{'precint'}\n";
print MAIL "Comments: $mes{'comments'}\n\n";

print MAIL "The above information is a new entry in your guest book\n";
print MAIL "If you deem this entry unappropriate, you may delete it here:
close (MAIL);

KJW
 
wierd, try removing the extra newline from the to field:

print MAIL "To: $recipient\n";

not that I think that could really be the reason but I see nothing in the code you posted that would cause the problem you describe.

 
I would imagine this would be how your Sendmail is set up as it does not appear that your script is responsible


Kind Regards
Duncan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top