The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to send contents of a file to email as a message ali560045 Shell Programming and Scripting 5 12-07-2007 08:53 AM
send a message through email to 5 people using unix script. MARY76 UNIX for Advanced & Expert Users 3 02-05-2007 03:42 PM
send a message through email to 5 people using unix script? MARY76 Shell Programming and Scripting 2 02-05-2007 03:29 PM
Send email where # is in the email address - Using Unix jingi1234 UNIX for Dummies Questions & Answers 1 05-23-2005 11:23 AM
Unable to send eMail from a UNIX-Host ( using mailx ) to a Outlook-email-addres(Win) Vetrivela UNIX for Advanced & Expert Users 2 02-15-2005 10:43 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-05-2007
MARY76 MARY76 is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 11
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 (permalink)  
Old 02-05-2007
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,190
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 (permalink)  
Old 02-05-2007
MARY76 MARY76 is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 11
thanks

Thanks,I am sorry.
  #4 (permalink)  
Old 02-06-2007
MARY76 MARY76 is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 11
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 (permalink)  
Old 02-06-2007
sb008 sb008 is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 384
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 (permalink)  
Old 02-06-2007
MARY76 MARY76 is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 11
thanks!

Hi Sboo8,thanks! I will try and let you know.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 01:31 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0