473,378 Members | 1,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Formatting mailmessage.body by string concatenation

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
Oct 4 '08 #1
1 2067
Pasquale wrote:
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.

--
Göran Andersson
_____
http://www.guffa.com
Oct 4 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: John Scott | last post by:
Hi There. I have a small c# problem. I am trying to create a dynamic email body. The body may be larger than the maximum number of characters a string can have (256?). I build the string like...
3
by: Mike P | last post by:
Can the MailMessage class be used to send emails from a machine that has no email account (such as Outlook)? Mike *** Sent via Developersdex http://www.developersdex.com *** Don't just...
0
by: desi.american | last post by:
I'm using System.Web.Mail to send an email message from an ASP.NET web page. This is the main section of the code. //************* start code ***************************** string mailHost =...
3
by: Phil Mc | last post by:
Hi has anyone come accross the problem.... with referance to System.Web.Mail.MailMessage and System.Web.Mail.SmtpMail THIS WORKS FINE mail=new MailMessage(); mail.From =...
0
by: gh0st54 | last post by:
Hi i'm looking for how to change the date of out going messages i tried this but it doesn't seems to work static public bool SendEmail(string To, string From, string Subject, string Body,...
4
by: Aren Cambre | last post by:
Why does SmtpMail.Send throw an exception if the MailMessage's BodyFormat = MailFormat.Html? I've searched all over the place and cannot find a solution anywhere. I am running this on Windows XP...
3
by: Anthony Fine | last post by:
Hello All, I have a VB.Net app that needs to send mail. I have created a class for building my e-mail, but keep getting the error (Could not access 'CDO.Message' object.) when trying to send...
1
by: Michel Couche | last post by:
Hello, I am starting the development of a newsletter The use of the class MailMessage of System.Net.Mail is quite straightforward for usual contact forms but my question here is "How can I...
1
by: SAL | last post by:
Hello, I am sending an e-mail message from my ASP.NET 2.0 application. The body of the message is coming from a database and formatting has already been applied to the text. My problem is that if...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.