Dale wrote:
> Hi,
> 
> I'm hoping someone can help me with an issue I've got with, I assume,
> sendmail.
> 
> I've copied part of a script below.  If I use the first To: line (which
> takes the e-mail address from a file - and this works) then a mail
> doesn't arrive.  If, however, I used the second To: line (which is
> currently commented out - the xxxxxx is to stop spammers picking the
> address up from this mail) then a mail is received.
> 
> I added a page after the sendmail just to make sure it was reading the
> e-mail address from the file (which it was) but it still doesn't seem to
> send. $manageremail is the correct variable name.
> 
> In the datafile, I've had the e-mail addresses formatted properly (e.g.
> [EMAIL PROTECTED]) but also tried with \'s at appropriate places (e.g.
> [EMAIL PROTECTED]).  I just can't get anything to work.
> 
> Anyone have any ideas what I could be doing wrong.
>

You're not using a module... Don't think that is what you meant though.

> Thanks in advance!
> 
> -------------------------------------------------------------------------
> -------------------------
>   open(MAIL, "|/usr/local/bin/sendmail -t");
> 
>     print MAIL "To: $manageremail\n";

Are you chomp'ing $manageremail?  If it has a newline on it in the file
and you have added an additional new line above then you have stopped
the header, surprisingly it should still be sending but below should be
in the body. You should probably have a look at the mail logs generated
by sendmail to see if it is complaining, and more specifically about what.

http://danconia.org

> #   print MAIL "To: [EMAIL PROTECTED]";
>     print MAIL "From: [EMAIL PROTECTED]";
>     print MAIL "Subject: Escalation logged\n";
> 
>     print MAIL "Hi $manager\.\n\n";
>     print MAIL "The following escalation has been logged from your
> team.\n\n";
>     print MAIL "Agent's Manager   : $manager\n";
>     print MAIL "Agent's Name      : $agentname\n";
>     print MAIL "Date Logged       : $day\-$month\-$year\n";
>     print MAIL "Escalation Reason : $reason\n";
>     print MAIL "Short Description : $short\n";
>     print MAIL "Long  Description : $long\n";
>     print MAIL "Justified?        : $justified\n";
>     print MAIL "Name of Logger    : $logger\n";
> 
>   close (MAIL);
> -------------------------------------------------------------------------
> -------------------------
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to