04-29-2008
mail function problem
Hello all,
I'm attempting to sent an e-mail with the following funtion in my script. The tested that the logic is correct with another native os command, but I can't seem to get mail to work. I played with the "", just can't seem to get it right. Any ideas? Thanks.
$my_mail = `mail -s`;
sub mail {
$my_mail "test"
my.name@company.com < /dev/null;
}
db_util.pl" 59 lines, 869 characters
./db_util.pl
String found where operator expected at ./db_util.pl line 57, near "$my_mail "test""
(Missing operator before "test"?)
Bareword found where operator expected at ./db_util.pl line 57, near ""test" my"
(Missing operator before my?)
Array found where operator expected at ./db_util.pl line 57, at end of line
Bareword found where operator expected at ./db_util.pl line 57, near "/dev/null"
(Missing operator before null?)
syntax error at ./db_util.pl line 57, near "$my_mail "test""
Execution of ./db_util.pl aborted due to compilation errors.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
When I try to use the CLI mail, I get the following error. What's wrong?
Welcome to Darwin!
% mail root
Subject: test
test
.
EOT
% /etc/mail/sendmail.cf: line 81: fileclass: cannot open /etc/mail/local-host-names: Group writable directory
Do I just need to change the... (1 Reply)
Discussion started by: chenly
1 Replies
2. Solaris
Can some one please help to configure mails on Solaris.
mail -s or mailx function don't work on the system. Commands do nothing. (2 Replies)
Discussion started by: raman1605
2 Replies
3. Shell Programming and Scripting
Hi,
currently I am using following command to send a mail:
mail -s"Query result" $TO $CC < input_file
It works, but I want to change the dispatcher's name / sender's name.
I tried to find something in "man mail", but I didn't find anything.
can someone help me?
THX
... (2 Replies)
Discussion started by: ABE2202
2 Replies
4. Shell Programming and Scripting
#!/bin/bash
{
m()
$mail='("$someemail@gmail.com ", Cc:"$me" -t, Subject:"$emailmyself" -s, $someinputfile")'
}
what I am trying to do is create a function have it load when type the letter "m" so all have to do type an address after it send email. it tell me syntax on line 4 but which... (2 Replies)
Discussion started by: ericde
2 Replies
5. Shell Programming and Scripting
Hi All
I have a business requirement where I have to send mails to multiple persons in TO as well as BCC
I tried the below mail command to meet the requirement
mailx -s "Sub" -c $mail_id_cc $mail_id_to
But I have a problem here because I can include the FROM part in this mail function... (0 Replies)
Discussion started by: ami_smart
0 Replies
6. Shell Programming and Scripting
Hello,
I am using centos-6.2
I have apache server,php5 on my system and I want to send mail using sendmail on my system.
when I try to send mail from shell that time mail is succesfully sent to respective address()
but when I try to send it through webbrowser I am not able to send it.... (1 Reply)
Discussion started by: Kiran ursal
1 Replies
7. Shell Programming and Scripting
Hi Guys,
i'm new to scripting, please help me to write the script.
Purpose: To write a simple addition program and to mail the output result.
Script:
#!/bin/bash
echo "entr numbers";
read n1;
read n2;
answer=$(($n1+$n2));
echo $answer > mail -s "output" karthic324n@gmail.com;
... (4 Replies)
Discussion started by: Karthick N
4 Replies
8. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
The function will be called m and it will allow you to send an email to someone using the mail command. The... (1 Reply)
Discussion started by: Drucian
1 Replies
9. Shell Programming and Scripting
I have a file named email.html with this as the contents:
Content-type: text/html
ACHI,ACCRETIVE HEALTH ,7.15,<br>CPRT,Copart Inc.,36.14,<br>GEOB.MX,GEO-B,1.660,<br>GCO,Genesco Inc. Comm,73.58,<br>GMAN,Gordmans Stores, ,<br>GES,Guess? Inc. Comm,26.45,<br>KBR,KBR Inc. Common... (1 Reply)
Discussion started by: phpchick
1 Replies
10. Shell Programming and Scripting
Hi Guys,
I have executed the mail command that has attachment with filename as current date enclosed in system function that is added under awk command.
I have used awk command to check if the error code is present in the file then email command sends an email with subject Error Code ,body... (2 Replies)
Discussion started by: reminisce
2 Replies
LEARN ABOUT FREEBSD
forward
FORWARD(5) BSD File Formats Manual FORWARD(5)
NAME
forward -- mail forwarding instructions
DESCRIPTION
The .forward file contains a list of mail addresses or programs that the user's mail should be redirected to. If the file is not present,
then no mail forwarding will be done. Mail may also be forwarded as the standard input to a program by prefixing the line with the normal
shell pipe symbol (|). If arguments are to be passed to the command, then the entire line should be enclosed in quotes. For security rea-
sons, the .forward file must be owned by the user the mail is being sent to, or by root, and the user's shell must be listed in /etc/shells.
For example, if a .forward file contained the following lines:
nobody@FreeBSD.org
"|/usr/bin/vacation nobody"
Mail would be forwarded to <nobody@FreeBSD.org> and to the program /usr/bin/vacation with the single argument nobody.
If a local user address is prefixed with a backslash character, mail is delivered directly to the user's mail spool file, bypassing further
redirection.
For example, if user chris had a .forward file containing the following lines:
chris@otherhost
chris
One copy of mail would be forwarded to chris@otherhost and another copy would be retained as mail for local user chris.
FILES
$HOME/.forward The user's forwarding instructions.
SEE ALSO
aliases(5), mailaddr(7), sendmail(8)
BSD
July 2, 1996 BSD