Spaces get eaten in an email

  • Thread starter Thread starter Adrian
  • Start date Start date
A

Adrian

How do I stop spaces from disappearing in an email I make up in an
application? I found that \r\n has to be replaced by other characters,
so presumably spaces have to be replaced as well: but by what? Please
respond.

Many thanks,
Adrian.
 
Adrian said:
How do I stop spaces from disappearing in an email I make up in an
application? I found that \r\n has to be replaced by other characters, so
presumably spaces have to be replaced as well: but by what? Please
respond.

Are you sending the email in HTML format? If so, it is not that the
spaces disappear (they do get sent in the body of the email), it's that the
browser renders a sequence of spaces as a single space on screen, when the
addresee views the email. If you want all of them rendered, replace each
space with " " (means "non-breaking space").
 
No not using html but this line which you will recognise
string message = string.Format("mailto:{0}?subject={1}&body={2}",
e_address, subject, body);

The spaces within ToString("blabla ####.##")
are being eaten up and do not appear in the email.

Adrian.
 
Adrian said:
No not using html but this line which you will recognise
string message = string.Format("mailto:{0}?subject={1}&body={2}",
e_address, subject, body);

The spaces within ToString("blabla ####.##")
are being eaten up and do not appear in the email.

I have not tried this out, but I believe that you will need to replace
the spaces with %20 (their hex representation in a url).
 
No that doesn't do the job (:


Alberto Poblacion said:
I have not tried this out, but I believe that you will need to replace
the spaces with %20 (their hex representation in a url).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top