• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 185
  • Last Modified:

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.
0
MatthewF
Asked:
MatthewF
  • 3
  • 2
  • 2
  • +1
1 Solution
 
scuzzieCommented:
try using angled brackets
<with spaces@somewhere.com>

0
 
MatthewFAuthor Commented:
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
0
 
scuzzieCommented:
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
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
SmartIntelCommented:
have you tried
$add="\'Client Number\@Life.com\'";

0
 
MatthewFAuthor Commented:
SmartIntel:, yes and this didnt work either
0
 
TintinCommented:
What code/module are you using to send the mail?
0
 
MatthewFAuthor Commented:
a system call to mailx
0
 
TintinCommented:
Can you please show us the exact system call in your script.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now