Link to home
Start Free TrialLog in
Avatar of MatthewF
MatthewFFlag for Afghanistan

asked on

How to send an email to an address with spaces?

I have a perl script that uses mailx to email a group of people and email groups. Two of the groups have spaces in the names.  In my variable for the address, $TO, I have tried using double quotes single quotes around the group with spaces but no luck.
Avatar of scuzzie
scuzzie
Flag of United Kingdom of Great Britain and Northern Ireland image

try using angled brackets
<with spaces@somewhere.com>

Avatar of MatthewF

ASKER

I tried $add1="<Client Number\@Life.com>"; and I get the following error when I tried to run it

sh: syntax error at line 1: `<' unexpected
hmm, don't know then. it is valid to have a space as far as i know. maybe whatever library you are using doesn't support it, or strips it out
ASKER CERTIFIED SOLUTION
Avatar of SmartIntel
SmartIntel
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SmartIntel:, yes and this didnt work either
Avatar of Tintin
Tintin

What code/module are you using to send the mail?
a system call to mailx
Can you please show us the exact system call in your script.