error-when trying to send the message thru email.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting error-when trying to send the message thru email.
# 1  
Old 02-05-2007
error-when trying to send the message thru email.

Hi All,
I want to send a message through email.
I have written below code. But it is not worling. Anybody has idea, why it is not working?.
export $file1=$home1/pip1.$$
mailx -s "This Message from unix" abc@yahoo.com< $file1

thanks,Mary.
# 2  
Old 02-05-2007
Mary, please do not post to multiple forums it is against the rules.

The problem is this line:

export $file1=$home1/pip1.$$


This is not the correct way to export a variable

The correct syntax is
Code:
export [name[=word]] ...

no $ in name.

Last edited by reborg; 02-05-2007 at 03:49 PM..
# 3  
Old 02-05-2007
thanks

Thanks,I am sorry.
# 4  
Old 02-06-2007
Unable to resolve this email issue

Hi All,
Still I am unable to resolve this issue.
I am trying to sending email to me through unix, but I am not getting it. Any configurations are there from unix side to send email. Please let me know. I wrote following code.

mailx -s "This is test message." xyz@yahoo.com.
Please help me.
# 5  
Old 02-06-2007
Based on what you posted sofar:

export $file1=$home1/pip1.$$
mailx -s "This Message from unix" abc@yahoo.com< $file1

As already pointed the assignment is wrong and should be:
export file1=$home1/pip1.$$

But even then, the question is whether that file actually exists.

$$ is replaced by the proces id of either the process id of the shell you are using if you execute this on the command line, or the process id of the script in which these line occur.

The change a file like that exists is really small unless you created it first.

If we are dealing with a script it might be wise to post the full script.

When you use these lines, either on the command line or within a script, are there any error messages displayed?

If so post them here.

If you use a script for which stderr is redirected, remove this redirection to see the errors.

If the file does exist and the commands do not generate an error message you can try the following command:

mailx -v -s "This Message from unix" abc@yahoo.com< $file1

This to see if mail is properly configured.
# 6  
Old 02-06-2007
thanks!

Hi Sboo8,thanks! I will try and let you know.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Capture all error message in Log file and send the Log file by email

Hi I have a requirement to write a script to capture all errors in a Logfile and send the file in email. If there is any error occurred the subject of email will be ERROR , If there are no error occurred the subject of email will be SUCCESS. So I created a Log file and put the Appropriate... (2 Replies)
Discussion started by: dgmm
2 Replies

2. UNIX for Dummies Questions & Answers

new to ldap, send email to a ou or group, and see a list from email client

hi, i'm running openldap on ubuntu 10.04, creating new items with apache directory studio (windows version). i use the ldap just as an address book to our small office (email clients are windows live mail 2009, 2011, microsoft outlook 2007 and 2010). a. i cant see a list of the contacts,... (0 Replies)
Discussion started by: V4705
0 Replies

3. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

4. Solaris

Send an email from Solaris using Linux email server

Hello everyone I have a problem and I need your help: I have a Solaris 10 and Solaris 8 UNIX Servers, and Linux Centos4 as email server. I need send an email from Solaris servers preferably using Centos4 email server. I have no mail service configured in my Solaris computers (1 Reply)
Discussion started by: aflores
1 Replies

5. Shell Programming and Scripting

Send email on script error

I need to start off by saying that I am not much of a programmer and know enough to cause lots of trouble. I've been writing this script to decrypt an XML feed, then parse the feed into a database. The script is executed from cron. #!/bin/sh PGPPATH=/path/to/directory echo "pgp... (6 Replies)
Discussion started by: Aslan_Eident
6 Replies

6. Shell Programming and Scripting

how to send contents of a file to email as a message

i have a file new1.txt i want to send the contents of that file as a message to email ali@sms.com i m using ksh script......... plz help me (5 Replies)
Discussion started by: ali560045
5 Replies

7. UNIX for Advanced & Expert Users

send a message through email to 5 people using unix script.

Hi All, I want to send a message through email to 5 people in unix script. Please let me know, how to do it.Please do reply it is urgent. Thanks, Mary. (3 Replies)
Discussion started by: MARY76
3 Replies

8. Shell Programming and Scripting

send a message through email to 5 people using unix script?

Hi All, I want to send a message through email to 5 people in unix script. Please let me know, how to do it.Please do reply it is urgent.How to do it?Please reply.thanks! Thanks, Mary. (2 Replies)
Discussion started by: MARY76
2 Replies

9. UNIX for Advanced & Expert Users

Unable to send eMail from a UNIX-Host ( using mailx ) to a Outlook-email-addres(Win)

Hi A) I am able to send eMail using mailx from a UNIX ( solaris 8 ) host to my Outlook-email-ID : FName.Surname@Citigroup.com ( This is NOT my actual -eMail-ID). But in Outlook the "From :" eMail address is displayed as " usr1@unix-host1.unregistered.email.citicorp.com " .i.e the words... (2 Replies)
Discussion started by: Vetrivela
2 Replies
Login or Register to Ask a Question