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

trying to use AIX mail to send a email 2

Status
Not open for further replies.

jcarrott

Programmer
May 28, 2009
130
US
I am trying to send an email from within Perl. I know the easy way to do this is to use MIME::Lite.

I do not have that option.

I typed:
mail -s 'TEST' myname@company.org < test.txt
at the prompt and the file test.txt was used in the body of the email plus the email was sent.

In Perl, I used
Code:
$rc=system("mail -s 'TEST' myname@company.org < test.txt");

The process does create the email, but it gets an error.

Code:
$ myname.org... User unknown
/home/myname/dead.letter... Saved message in /home/myname/dead.letter

The dead.letter in my home directory does contain the file.

I really want to use a variable from the program called $message_body rather than a file from the system.

It seems I am missing a command to close the editor that created the email.

Can somebody help me??
 
Well, for one thing, you need to hide the @-character from perl. I don't know the syntax for it, but you can find that out from a manual.


HTH,

p5wizard
 
Correct p5wiz

The @ needs to be escaped
myname\@company.org

&quot;If you always do what you've always done, you will always be where you've always been.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top