473,385 Members | 2,005 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,385 software developers and data experts.

Mail.Body HTML syntax

Hi,
I am using the MailMessage method to send an email from a form and I have
the following code giving me the following error on line 79:

Compiler Error Message: CS1002: ; expected
Source Error:

Line 78: Mail.BodyFormat = MailFormat.Html;
Line 79: string MailBody = "(<html><body>Dear " +
usercredentials.Name + "<br><p><strong>Your sequence
is</strong>:</p></body></html>");

But this works fine:

Line 78: Mail.BodyFormat = MailFormat.Html;
Line 79: string MailBody = "<html><body>Dear " +
usercredentials.Name;

So is this:

Mail.BodyFormat = MailFormat.Text;
string MailBody = "Your sequence is:" + Order.BlockSequence;
What am I doing wrong?

Thanks,
Stephan.

Nov 17 '05 #1
2 2050
Stephan,

You can't let string literals wrap across lines. Try this instead:

Mail.BodyFormat = MailFormat.Html;
string MailBody = "(<html><body>Dear " +
usercredentials.Name + "<br><p><strong>Your sequence " +
"is</strong>:</p></body></html>");

HTH,
Nicole
"Stephan Bour" <sb***@niaid.nih.gov> wrote in message
news:BBBAE447.A482%sb***@niaid.nih.gov...
Hi,
I am using the MailMessage method to send an email from a form and I have
the following code giving me the following error on line 79:

Compiler Error Message: CS1002: ; expected
Source Error:

Line 78: Mail.BodyFormat = MailFormat.Html;
Line 79: string MailBody = "(<html><body>Dear " +
usercredentials.Name + "<br><p><strong>Your sequence
is</strong>:</p></body></html>");

But this works fine:

Line 78: Mail.BodyFormat = MailFormat.Html;
Line 79: string MailBody = "<html><body>Dear " +
usercredentials.Name;

So is this:

Mail.BodyFormat = MailFormat.Text;
string MailBody = "Your sequence is:" + Order.BlockSequence;
What am I doing wrong?

Thanks,
Stephan.

Nov 17 '05 #2
Stephan,

You can't let string literals wrap across lines. Try this instead:

Mail.BodyFormat = MailFormat.Html;
string MailBody = "(<html><body>Dear " +
usercredentials.Name + "<br><p><strong>Your sequence " +
"is</strong>:</p></body></html>");

HTH,
Nicole
"Stephan Bour" <sb***@niaid.nih.gov> wrote in message
news:BBBAE447.A482%sb***@niaid.nih.gov...
Hi,
I am using the MailMessage method to send an email from a form and I have
the following code giving me the following error on line 79:

Compiler Error Message: CS1002: ; expected
Source Error:

Line 78: Mail.BodyFormat = MailFormat.Html;
Line 79: string MailBody = "(<html><body>Dear " +
usercredentials.Name + "<br><p><strong>Your sequence
is</strong>:</p></body></html>");

But this works fine:

Line 78: Mail.BodyFormat = MailFormat.Html;
Line 79: string MailBody = "<html><body>Dear " +
usercredentials.Name;

So is this:

Mail.BodyFormat = MailFormat.Text;
string MailBody = "Your sequence is:" + Order.BlockSequence;
What am I doing wrong?

Thanks,
Stephan.

Nov 17 '05 #3

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

Similar topics

7
by: PeterR | last post by:
I've spent weeks trying to write a function that is simple to use for sending emails with attachments, but I my programming skills are not that advanced. I've noticed a few postings in these...
6
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
0
by: Stephan Bour | last post by:
Hi, I am using the MailMessage method to send an email from a form and I have the following code giving me the following error on line 79: Compiler Error Message: CS1002: ; expected Source...
1
by: g_sharad | last post by:
I want to send the full html page thru this SMTP server mail. When I send it, only the URL of the page is sent, I was doing fine with CDONTs, but when I shifted to CDOSYS, i face this problem. the...
34
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow...
1
by: Mike P | last post by:
I am building a message body to be sent by email, but I can't seem to get the correct syntax for 2 lines where I am defining the <formand trying to pass parameters and where I am creating a...
0
by: misra | last post by:
Hi, I am using a C# code to call blat and send mail. When I send mails with long sentences, the mail automatically is send with multiple lines. However, certain times the body and format of the...
14
by: Jeff | last post by:
I'm writing my php "form mail" script. Does mail do any checking for header injection in the "to" and "subject" parameters? CR and/or LF? It seems to me it easily could and should, but does it?...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.