Formatting mailmessage.body by string concatenation

P

Pasquale

I want to send an email with smtpclient.
I have created a MailMessage with body obtained as concatenation between a
fixed string, that finishes with a space, and a string variable.
The code is as this:
MailMessage.Body = "Title " + strTitle.
The variable strTitle is read from a SharePoint list.
When I read the mail, I see that the space in the fixed string is lost.
Do you have any suggests to solve this issue? Thanks
 
G

Göran Andersson

Pasquale said:
I want to send an email with smtpclient.
I have created a MailMessage with body obtained as concatenation between a
fixed string, that finishes with a space, and a string variable.
The code is as this:
MailMessage.Body = "Title " + strTitle.
The variable strTitle is read from a SharePoint list.
When I read the mail, I see that the space in the fixed string is lost.
Do you have any suggests to solve this issue? Thanks

You have to determine where the space is lost. View the source code of
the mail to see if the space is there or not. If it's not, debug the
code that creates the mail to determine where in the code is goes away.
 

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

Top