Solved

How to send an email to an address with spaces?

Posted on 2008-09-29
8
162 Views
Last Modified: 2012-05-05
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
Comment
Question by:MatthewF
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 1

Expert Comment

by:scuzzie
ID: 22595799
try using angled brackets
<with spaces@somewhere.com>

0
 

Author Comment

by:MatthewF
ID: 22595892
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
 
LVL 1

Expert Comment

by:scuzzie
ID: 22596361
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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 5

Accepted Solution

by:
SmartIntel earned 425 total points
ID: 22596363
have you tried
$add="\'Client Number\@Life.com\'";

0
 

Author Comment

by:MatthewF
ID: 22596425
SmartIntel:, yes and this didnt work either
0
 
LVL 48

Expert Comment

by:Tintin
ID: 22599957
What code/module are you using to send the mail?
0
 

Author Comment

by:MatthewF
ID: 22600003
a system call to mailx
0
 
LVL 48

Expert Comment

by:Tintin
ID: 22600693
Can you please show us the exact system call in your script.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
perl rename 2 143
perl script 4 106
How to get all the API from website? 11 84
Perl: How to add backslashes to every period in a string 1 21
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question