Solved

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

Posted on 2002-04-11
3
181 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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…

831 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