Mailx issue; email address starting with #

Tags
shell scripts

 
Thread Tools Search this Thread
# 1  
Old 04-24-2018
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"

# 2  
Old 04-24-2018
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
This User Gave Thanks to rbatte1 For This Post:
Pradeep_Raj (04-24-2018)
# 3  
Old 04-24-2018
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

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Mailx Email Issue yuvi Shell Programming and Scripting 5 11-27-2018 04:39 PM
Mailx command to include sender address usrrenny Shell Programming and Scripting 1 07-20-2016 09:35 AM
Mailx options to change from address arun888 Shell Programming and Scripting 3 09-22-2015 07:32 AM
Email address change issue elixir_sinari Forum Support Area for Unregistered Users & Account Problems 3 10-16-2012 04:48 PM
Customizing from address in mailx command pandeesh UNIX for Dummies Questions & Answers 2 12-10-2011 11:43 AM
configure from address in mailx command latika Shell Programming and Scripting 9 08-25-2011 08:01 AM
mailx to external email address FlyingSquirrel OS X (Apple) 4 07-21-2011 10:34 AM
email address starting with dash akaq AIX 1 06-26-2009 05:52 AM
How to verify email address using mailx command ? rak007 UNIX for Dummies Questions & Answers 1 06-11-2009 08: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 09:34 AM
change from address in mailx koti_rama Shell Programming and Scripting 1 09-26-2007 05:26 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 08:37 AM
Send email where # is in the email address - Using Unix jingi1234 UNIX for Dummies Questions & Answers 1 05-23-2005 12:23 PM
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
mailx sender address customisation vasan_srini UNIX for Dummies Questions & Answers 1 09-10-2001 09:40 AM