473,406 Members | 2,710 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,406 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 2051
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.