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

help with sending mail

Status
Not open for further replies.

revit

Programmer
Oct 27, 2001
36
IL
I wrote a simple script for sending mail:
open (MAIL, "|$mailprog -t") ;
print MAIL "To: $cgi_data{'emailAddrs'}\n";
print MAIL "From: $cgi_data{'XX-email'}\n";
close (MAIL);

it works without errors but i don't get any mail to my e-mail.
what could be my mistake?
thanks!
 
Usually you need to have an blank line after your email headers. Try adding print MAIL "\n"; before the close. If that doesn't work, try temporarily changing your open to open(MAIL, "|cat")'. That will make you email print to the broswer instead, so you can check and see if the correct values are being printed. Make sure you're printing a content-type header first, and be sure to specify $| = 1; near the beginning of your program so the prints will come out in the correct order. (That line tells perl to flush stdout after every print. Otherwise normal prints to stdout and the prints to MAIL that are sent to stdout by the cat command may not come out in the order they are executed.) Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top