Hi,
I am new to shell scripting and thus any help will be highly appreciated. I need to write a K shell script where in the email sending feature should be handled by sendmail utility and I have come up with the following :
However, I need to alter the shell so that it can take the From field, To field and any file attachment as parameter.
Can anyone kindly help ?
Thanks a lot in advance....
Last edited by pludi; 06-22-2010 at 01:40 AM..
Reason: code tags, please...
*** you could cat a file `cat $filename` or echo another variable echo "$variable" instead of having to type it out. Any one of the args could be variables.
I.E.
mailto="user@domain.com"
from="me@mydomain.com"
subject="Cool email"
body="this is the body of the email and can go on from quite some time"
Hi mph,
Thanks a lot for the reply. The entire code looks like :
However, when I tried to run the same with the following command line
./test.ksh abc@xyz.comxyz@abc.com subject body , it gave an error as follows :
No recipient addresses found in header
Any idea ?
Hi,
Thanks a lot for the same. Therefore, I will be running the shell script with the following command.
./new.ksh abc@xyz.comsupport@xyz.com subject body
[new.ksh is the script name]
Is this correct ?
Additionally, what does -t stand for ? For every parameter like To field, Cc field, body, subject, do I need to specify the options like -f, -t etc ?
I 'm afraid I don't know all the options that sendmail accepts in command line and how to use them.
Please reply...
---------- Post updated at 11:13 AM ---------- Previous update was at 10:21 AM ----------
Hi,
I wrote the script like as follows :
While running the script, I am using the following at the command line:
./test.sh Sub Body support@abc.com support@xyz.com
It is running fine, however the subject line or the body is empty ( I expected at the subject line & body the word Sub and Body will be displayed )
Could you please let me know the following ?
If I need to add Cc, signature and attachment, what change needs to done in the code ?
Consequently, while running the script, what should be the exact command line so that whatever I write agaist subject field, body field and others will be populated accordingly ?
Hi friends,
I want to converting a task ,of making few words in my task mail bold and underlined sometimes, automated through sendmail.
I have never used sendmail/mailx before.
What i want is my ouput which looks like below:
+++++++++++++++
DETAILS: sqlid:6mbiosdfsdff parsing_schema_name:... (1 Reply)
Hi, all:
Which shell command or utility will call the open(), close(), hard_start_xmit(), rtl8139_rx(), or interrupt() functions in a network device driver I am debugging?
Can "ping", "ftp", "scp", or "internet browser" finally call them?
Best regards!
li, kunlun (0 Replies)
Hi. Question from a novice. I'd like to have a unix script that sends me an email message, but I have no clue on the syntax. I do know this works from my mailtest.sh script:
/usr/lib/sendmail steve@me.com < /dev/null
This sends me a blank email. I'm hoping someone can help me to build... (3 Replies)
I need some help to run this executable from within a shell script.
The Script is run the following way at the command prompt.
$rateupd
Main Menu --Standard Output
----------- --Standard Output
1. - Update Rate --Standard Output
2. - Exit. --Standard Output
Enter Selection: 1 --User... (5 Replies)
Hi All,
I need to do a lot of manual entries at shell prompt.
So to collect the logs(each command fired in that session, i use "SCRIPT(1) : make typescript of terminal session"
this is kool,but the problem here is that it saves the linefeed, and backspaces along with the commands in the log... (1 Reply)
Hello,
My System Admin. just switched me from KSH to BASH and something happened to my "nedit" utility!
Does anyone know how to reactivate nedit by anychance?
Thanks very much!
BobK (2 Replies)
Hi,
I am a beginner. I need an example of using DB2 Load Utility in Shell script.
I appreciate if anyone could help me about it.
Thanks,
Paris (0 Replies)
Not sure if this is the right place to be posting this. If not, let me know where it fits. I am running RedHat Linux 8.0. I've recently acquired a Sony Mavica digital camera. In short, this thing is awesome (uses cd-rw!). I have been taking high quality images, but I now have the need to try... (2 Replies)
I am facing problem while accesing FTP related commands in nawk code in bourne shell programming.I can able to connect to remote machine, but i can't able to get files from that machine.
Please help me in this.If you send code along with the solution, then it will be usefull for me. (4 Replies)