Solved

Sendmail isn't working like it's supposed to...

Posted on 2002-04-11
3
172 Views
Last Modified: 2010-03-05
Okay, here's the deal.  I've got a site on Hypermart and they say "The mail program is located at /var/qmail/bin/qmail-inject. You would use it the same way you use 'SendMail', by piping things into it."  So I throw this code into a perl script towards the top where it'll be sure to be run.  I access the script, but don't get any email.  What's my problem?

open(MAIL, "|/var/qmail/bin/qmail-inject -t") or print "ERROR, DUDE!";
print MAIL "To: assignat@yahoo.com\n";
print MAIL "From: assignat@yahoo.com\n";
print MAIL "Subject: This is lovely, eh?\n";
print MAIL "What do you think?  Did this work?  Huh?\n\n-Brian\n";
close(MAIL);

-Brian
0
Comment
Question by:pyrames
  • 2
3 Comments
 

Author Comment

by:pyrames
ID: 6936177
Anyone?
0
 
LVL 84

Accepted Solution

by:
ozo earned 300 total points
ID: 6936192
In string, @yahoo now must be written as \@yahoo at - line 1, near "To: assignat@yahoo" (#1)
   
    (F) It used to be that Perl would try to guess whether you wanted an
    array interpolated or a literal @.  It did this when the string was first
    used at runtime.  Now strings are parsed at compile time, and ambiguous
    instances of @ must be disambiguated, either by prepending a backslash to
    indicate a literal, or by declaring (or using) the array within the
    program before the string (lexically).  (Someday it will simply assume
    that an unbackslashed @ interpolates an array.)
0
 

Author Comment

by:pyrames
ID: 6936872
See?  I knew it was an easy answer!  I just wasn't seeing it...

Thanks!
-Brian
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question