?
Solved

Webmatrix & Razor & vbhtml.  How to include pagebreaks when sending a mail from webpage

Posted on 2015-02-20
3
Medium Priority
?
191 Views
Last Modified: 2015-02-27
Hi Experts.  I am sending a mail with the following which works correctly

Dim MailBody As string
MailBody = "1" & "2"
WebMail.Send(to:= "fred@google.com", subject:= "Testing the Mail", body:= MailBody)

But I need to format MailBody and cannot get any formatting to work
Not even line breaks

MailBody = "1" &  Environment.NewLine  & "2"

Doesn't work either.

Anyone know how to add line breaks to this?
Also is it possible to do an html mail with webmail?

Many Thanks
0
Comment
Question by:PNRT
  • 2
3 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 2000 total points
ID: 40621732
Code in email is basically going to be ignored by email programs and may even trigger a security alert.  As for HTML, each clint has ist own subset that it supports, and in addition the user has the option of blocking anything except text.

If You use any CSS in the email it is guaranteed to fail in many email clients, and gmail in particular will strip out any CSS that does not conform to its stylesheet.

As for adding line breaks, if the text contains line breaks then the client is generally going to render them As long as you are not using HTML.

Cd&
0
 
LVL 2

Author Comment

by:PNRT
ID: 40622721
Thank you for your reply
You say "if the text contains line breaks then the client is generally going to render them  ".
Do you perhaps know how to add line breaks to the above code?  As you can see, I'm not using HTML
but the line breaks as show above are still not working.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40623525
I don't see anything that looks like a linefeed that is going to be processed as anything by white space if you want HTML in the client to use linbreaks, then you need to use the HTHL break tag <br />

Cd&
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses
Course of the Month17 days, 10 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question