Unix/Linux Go Back    


Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Mailx issue; email address starting with #

Shell Programming and Scripting


Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 04-24-2018   -   Original Discussion by Pradeep_Raj
Pradeep_Raj's Unix or Linux Image
Pradeep_Raj Pradeep_Raj is offline
Registered User
 
Join Date: Oct 2017
Last Activity: 24 April 2018, 7:24 AM EDT
Posts: 6
Thanks: 4
Thanked 0 Times in 0 Posts
Mailx issue; email address starting with #

Hello All,

I have a requirement to generate report and send them to a distribution list.
The problem I am facing is when sending out the email using mailx.
The email address (DL) we have is starting with # and because of this it's not recognising the email and throwing the below error.

Error"Send options without primary recipient specified"

When I try to put the email under "" then no email has been send out.

Appreciate your suggestions on this issue.

Thanks.



Code:
 

RECIPIENT=$RECIPIENT"#AppMIReporting@domain.com";

echo "$BODY" | mailx -r "$SENDER" -s "$SUBJECT" -a "$ODFILENAME" -a "$LOFILENAME" "$RECIPIENT"

Sponsored Links
    #2  
Old Unix and Linux 04-24-2018   -   Original Discussion by Pradeep_Raj
rbatte1's Unix or Linux Image
rbatte1 rbatte1 is offline Forum Staff  
Root armed
 
Join Date: Jun 2007
Last Activity: 21 June 2018, 9:53 AM EDT
Location: Lancashire, UK
Posts: 3,559
Thanks: 1,566
Thanked 699 Times in 627 Posts
Hello Pradeep_Raj ,

A few questions first, I'm afraid:-
  • What OS and version are you using?
  • Have you tried escaping the # with a \ like this:-
    RECIPIENT=$RECIPIENT"\#AppMIReporting@domain.com"
  • What is the value of $RECIPIENT before you start?


Thanks, in advance,
Robin
The Following User Says Thank You to rbatte1 For This Useful Post:
Pradeep_Raj (04-24-2018)
Sponsored Links
    #3  
Old Unix and Linux 04-24-2018   -   Original Discussion by Pradeep_Raj
Pradeep_Raj's Unix or Linux Image
Pradeep_Raj Pradeep_Raj is offline
Registered User
 
Join Date: Oct 2017
Last Activity: 24 April 2018, 7:24 AM EDT
Posts: 6
Thanks: 4
Thanked 0 Times in 0 Posts
Hi Robin,

I did a echo and could see $RECIPIENT has the full email address as the value.
I tried with escape / with no luck.

OS and Version:
Linux servername 2.6.32-358.18.1.el6.x86_64 #1 SMP Fri Aug 2 17:04:38 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux

Appreciate your suggestion on this issue.

Thanks,
Pradeep
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
mailx to external email address FlyingSquirrel OS X (Apple) 4 07-21-2011 09:34 AM
email address starting with dash akaq AIX 1 06-26-2009 04:52 AM
How to verify email address using mailx command ? rak007 UNIX for Dummies Questions & Answers 1 06-11-2009 07:17 AM
how to know if the mailx command really sends the mail to the email address? sheenshine Shell Programming and Scripting 3 09-17-2008 08:34 AM
mailx- can we change the from address in the email that is sent out. radhika UNIX for Dummies Questions & Answers 5 09-21-2005 07:37 AM



All times are GMT -4. The time now is 05:18 AM.