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.

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

export [name[=word]] ...

no $ in name.

Thanks,I am sorry.

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.

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.

Hi Sboo8,thanks! I will try and let you know.