Can someone tell me what I'm doing wrong? The sendmail section of my
script follows:
open (MAIL, "|$mailprog $recipient") || die "Can't open $mailprog!\n";
print MAIL "Reply-to: $FORM{'email'} ($FORM{'contact'})\n";
print MAIL "Subject: TVC Web Information (Forms submission)\n\n";
print MAIL "Name: $FORM{'contact'} \n";
print MAIL "E-Mail Address: $FORM{'email'}\n";
print MAIL "Company: $FORM{'company'}\n";
print MAIL "Address:\n";
print MAIL " $FORM('Addr1')\n";
print MAIL " $FORM('Addr2')\n";
.
.
.
\/
print MAIL "Server protocol: $ENV{'SERVER_PROTOCOL'}\n";
print MAIL "Remote host: $ENV{'REMOTE_HOST'}\n";
print MAIL "Remote IP address: $ENV{'REMOTE_ADDR'}\n";
close (MAIL);
$mailprog is set to "/bin/usr/sendmail", which is where sendmail
resides on the web server. $recipient is set to
"pme...@teamvision.com", which is my mail address.
I appreciate any help anyone can provide. I think it has something to
do with the way I'm using sendmail, but I haven't been able to find
any sendmail documentation.
======================
Peter Mellen
Team/Vision Consulting
3221 M Street, NW
Washington, DC 20007
202-298-6520 Voice
202-232-3006 Fax
======================
> hed...@best.com (M. Hedlund) writes:
<cut>
> >>The script executes without reporting any errors, but
> >> I never receive any mail!
I'm getting the same problem. The process reports that the mail has
been sent, but I'm not believing it anymore.
> >Try inserting
> > print MAIL "To: $recipient\n";
> >before the Subject.
>
> I believe that $mailprog will have to be defined as '/usr/lib/sendmail -t'
> for this to work. The -t option has sendmail read the To: address from the
> message. The order should not matter.
I believe that my code fulfills these recommendations. Also, we have
/user/sbin/sendmail, also with the -t option. Here's my code:
$webmaster = "el...@cais.com";
<cut>
open (MESSAGE, "| /usr/sbin/sendmail -t") || die "Can't open mail program.";
# Format email header information
print MESSAGE "To: $webmaster\n";
print MESSAGE "From: $ENV{'REMOTE_ADDR'}\n";
print MESSAGE "Reply-To: $FORM{feed_email}\n";
print MESSAGE "Subject: $subject\n\n";
# Write the actual email message
print MESSAGE "Answer from $FORM{feed_name} <$FORM{feed_email}>:\n\n";
print MESSAGE "$FORM{feed_comments}\n";
close (MESSAGE);
> hed...@best.com (M. Hedlund) writes:
<cut>
> >>The script executes without reporting any errors, but
> >> I never receive any mail!
I'm getting the same problem. The process reports that the mail has
been sent, but I'm not believing it anymore.
> >Try inserting
> > print MAIL "To: $recipient\n";
> >before the Subject.
>
> I believe that $mailprog will have to be defined as '/usr/lib/sendmail -t'
> for this to work. The -t option has sendmail read the To: address from the
> message. The order should not matter.
I believe that my code fulfills these recommendations. Also, we have
/user/sbin/sendmail, also with the -t option. (BTW, I know that the
forms data including sender and recipient are being read by the script
because I can print out the values, so it's not a problem with the
form, as far as I can tell.)
Here's my code:
--- begin ---
$webmaster = "el...@cais.com";
<cut>
open (MESSAGE, "| /usr/sbin/sendmail -t") || die "Can't open mail program.";
# Format email header information
print MESSAGE "To: $webmaster\n";
print MESSAGE "From: $ENV{'REMOTE_ADDR'}\n";
print MESSAGE "Reply-To: $FORM{feed_email}\n";
print MESSAGE "Subject: $subject\n\n";
# Write the actual email message
print MESSAGE "Answer from $FORM{feed_name} <$FORM{feed_email}>:\n\n";
print MESSAGE "$FORM{feed_comments}\n";
close (MESSAGE);
--- end ---
Lawrence Garfield
el...@cais.com
http://www.cais.com/elgar/home.htm
Before closing your mail with close (MAIL), add the line
print MAIL ".";
prakash
Prakash> Everything looks good except for one thing. You forgot to finish the
Prakash> mail by printing a 'dot'.
Prakash> Before closing your mail with close (MAIL), add the line
Prakash> print MAIL ".";
Uh, no.
Dot is only required when you are talking SMTP, and then you use the
"dot == end, double-dot == dot" encoding convention. Not necessary
at all when you are talking to sendmail.
Just another sendmail-guru and web-head,
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <mer...@stonehenge.com> Snail: (Call) PGP-Key: (finger mer...@ora.com)
Web: <A HREF="http://www.teleport.com/~merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
> > hed...@best.com (M. Hedlund) writes:
> <cut>
> > >>The script executes without reporting any errors, but
> > >> I never receive any mail!
why not use something that already works ?
ftp://ftp.middlebury.edu/pub/WWW/Web2Mail/
get it, it takes 60 seconds to configure it and run it.
successfuly, too.
Otis
> Here's my code:
> --- begin ---
> --- end ---
--
Men rule the World !
Women rule men.
A very wild guess that comes to
mind is that $REMOTE_ADDR is not a valid email address (it's an IP
address) so maybe sendmail tacks on a hostname (it wouldnt just break
would it?) and that without
-n some sort of aliasing may be taking place that takes you off the
recipient list. just a guess,though
Hope this maybe helps,
All the Best.
Stan Shapiro
--
>why not use something that already works ?
>ftp://ftp.middlebury.edu/pub/WWW/Web2Mail/
>get it, it takes 60 seconds to configure it and run it.
>successfuly, too.
>
>Otis
>
>> I'm getting the same problem. The process reports that the mail has
You can also use Getcomments to send e-mail. In addition you can append to
a file, and display text or and arbitary URL back to the user.
<URL:http://seclab.cs.ucdavis.edu/~hoagland/getcomments/>
Jim Hoagland
--
|* James A. Hoagland, Research Assistant, Computer Security Lab *|
|* University of California, Davis Department of Computer Science *|
|* <URL:http://seclab.cs.ucdavis.edu/~hoagland/> *|
|* Commit random acts of kindness and senseless acts of beauty. *|
I'm trying:
$sub="whatever!";
open (M, "| /usr/bin/mailx -s \"$sub\" $address <anyfile.xyz");
I do receive the file but directly in the body of the message (
any print M "blah blah"; gives no mail output).
Also how to include/attach more then one file?
THANKS.
Try "/usr/sbin/sendmail $webmaster" - it should work :)
Vassilis
+-----------------------------------------------------------------+
| Vassilis Terzopoulos : I am not young enough to know everything.|
| bac...@eexi.gr & b...@techlink.gr & vt...@leon.nrcps.ariadne-t.gr |
| http://www.eexi.gr/~bacardi - working at http://www.techlink.gr |
| * This is MY OWN opinion, not my employer's nor anyone else's * |
+-----------------------------------------------------------------+
No answer is also an answer.